1 修改config/index.js文件
proxyTable: {
'/':{
target: 'http://127.0.0.1:8000/', //请求的目标主机
changeOrigin: true
}
}
2 重新启动,更改本地请求主机为 http://localhost:8080
如:http://localhost:8080/get_records/
3 上线需改回后端提供主机
备注:主机可设置全局变量,请求时拼接,每次只需要更改这个全局变量