Vue solves the problem of invalid cross-domain by modifying the index.js under config, and the address has been changed.

vue solves the problem of cross-domain invalidation by modifying the index.js under config, and automatically changes the interface address to the side. The index.js code under
config is as follows:

    proxyTable: {
      "/api":{
        target: "http://api.jisuapi.com",
        changeOrigin: true,
        pathRewrite:{
          "^/api": ""
        }
      }
    },

axois request code is as follows:

const actions = {
  getList ({commit}, msg){
    const start = Math.floor(Math.random() * 100)
    if (msg.channel && msg.type && msg.flag) {
      axios.get("/api/news/get?channel="+ msg.channel +"&start="+ start +"&num=10&appkey=272f8fcb40a13a6e")
      .then(res =>{
        commit("GET_NEWSLIT",{
          data: res.data.result.list,
          kind: msg.type
        })
        console.log(res.data)
      })
    }
  },

I have no problem with the interface parameters here. Before, I used Google"s plug-in to access cross-domain data, but now I have to change the cross-domain to code

.

the page reported an error as follows

the api of the original address has become the present www

Apr.29,2022

I'll post a paragraph that I match, please change it and have a look

'/emsApi': {
    target: 'http://10.10.11.65:8094/api',
    changeOrigin: true,
    pathRewrite: {
      '^/emsApi': '/'
    }
  },
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bfedb4-32413.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bfedb4-32413.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?