vue项目生产环境配置代理一直405
1、过程 1)在config-->index.js中配置代理 proxyTable: {'/api/**': {target: 'http://**', // 你接口的域名// secure: false,// 如果是https接口,需要配置这个参数changeOrigin: true,// 如果接口跨域,需要...
·
1、过程
1)在config-->index.js中配置代理
proxyTable: {
'/api/**': {
target: 'http://**', // 你接口的域名
// secure: false, // 如果是https接口,需要配置这个参数
changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
}
},
2)在dev.evn.js配置默认路径
module.exports = {
NODE_ENV: '"development"',
ENV_CONFIG: '"dev"',
BASE_API: '"http://localhost:8080"' // 要配置本地地址,配置后台地址不能访问
}
2、原因
在dev.evn.js也配置了后台地址
3、参考
更多推荐
已为社区贡献6条内容
所有评论(0)