很多人如果换一个时间认识,就会有不同的结局。
第一种:
proxy: {
'/apis': {
target: 'https://xxxxxxx.com/', // target host
ws: true, // proxy websockets
changeOrigin: true, // needed for virtual hosted sites
pathRewrite: {
'^/apis': '' // rewrite path
}
},
}
将项目里面的这个地方改为空就OK
第二种
通过.env
文件
注意: 可以看这篇文章这里
VUE_APP_
是规定的命名格式
然后通过获取环境变量配置就OK!!
俺已经试过了, 是OK的!!!