vue.config.js
const config = {
devServer: {
proxy: {
"/api": {
//为用于替换的的标识字符串
target: "https://fxpc.mem.gov.cn", //Axios跨域请求的IP
changeOrigin: true,
ws: true,
pathRewrite: {
"^/api": "", //不用改
},
},
},
},
}
请求
Vue.axios.get('/api'+模块)