添加设置代理解决跨域示例

This commit is contained in:
zhigang.li 2018-08-30 18:15:42 +08:00
parent 378ec060c1
commit 7c58c94a42
1 changed files with 4 additions and 0 deletions

View File

@ -34,4 +34,8 @@ module.exports = {
},
// 打包时不生成.map文件
productionSourceMap: false
// 这里写你调用接口的基础路径来解决跨域如果设置了代理那你本地开发环境的axios的baseUrl要写为 '' ,即空字符串
// devServer: {
// proxy: 'localhost:3000'
// }
}