项目根目录新建vue.config.js
module.exports = {
publicPath: './',
devServer: {
port: 9999,
proxy: {
'/ecis': {
target: '后台接口地址',
changeOrigin: true,
pathRewrite: {
'^/ecis': ''
}
}
}
}
}
/ecis就指向后台接口地址了
项目根目录新建vue.config.js
module.exports = {
publicPath: './',
devServer: {
port: 9999,
proxy: {
'/ecis': {
target: '后台接口地址',
changeOrigin: true,
pathRewrite: {
'^/ecis': ''
}
}
}
}
}
/ecis就指向后台接口地址了
本文标题:vue跨域简单配置
本文链接:https://www.haomeiwen.com/subject/vfqjeltx.html
网友评论