Vue代理配置
在vue.config.js里添加
module.exports = {
publicPath: '/',
outputDir: 'dist',
assetsDir: 'static',
lintOnSave: false,
productionSourceMap: false,
devServer: {
port: port,
// open: true,
hot: true,
proxy: {
"/jx": {
target: "http://10.191.4.131:18088/",
changeOrigin: true,
pathRewrite: {
" ^/jx": "/jx"
}
},
"/api": {
target: "http://10.191.4.131:9899/ ",
changeOrigin: true,
pathRewrite: {
" ^/api ": "/api"
}
},
"/login": {
target: "http://10.191.4.131:9899/ ",
changeOrigin: true,
pathRewrite: {
" ^/login ": "/login"
},
},
"/exception": {
target: "http://10.191.4.131:9899/ ",
changeOrigin: true,
pathRewrite: {
" ^/exception ": "/exception"
}
}
}
}
}