vue2.x本地开发配置代理1.打开项目中的config->index.js文件2.修改proxyTable中的内容proxyTable:{"/service-core":{//putlocalhost:8080proxyforthefollowingaddresstarget:"https://test.eastgrain.cn",//localhost:8080proxyforthisaddresssecure:true,//如果是https,需要配置truechangeOrigin:true,//是否跨域//pathRewrite:{//重写,如果开发环境地址中不需要service-core,那么可以改写为''//"^/service-core":""//}}//你要代理的地址:'localhost:8080/service-core/wechat/serviceAccount/qrCode/create'//代理后的地址'https://test.eastgrain.cn/service-core/wechat/serviceAccount/qrCode/create'//axios请求接口写法axios.get('/service-core/wechat/serviceAccount/qrCode/create')...}按照上面的方法可以配置多个代理.3.重启项目,本地代理即可实现。
