配置文件在vue.config.js
module.exports = {
publicPath: './',
productionSourceMap: false,
devServer: {
proxy: {
'/test': {
target: "http://10.10.1.10",//这个是你要访问得接口地址
changeOrigin: true,
pathRewrite: {//重写地址 比如说 你的接口地址是'http://10.10.1.10/system/getUserInfo ' 你请求得时候地址只需要写'/test/getUserInfo'
'/test': '/system'
}
}
}
}
}
博客提及配置文件位于vue.config.js,这是前端开发中Vue项目的重要配置文件,可对项目进行多方面配置。
933

被折叠的 条评论
为什么被折叠?



