config/index.js文件夹下
proxyTable: {
'/api': {
target: 'https://xxxxxxx.com', //测试线
changeOrigin: true, // 是否跨域
secure: true,//是否是https
pathRewrite: {
'^/api': ''
}
},
},
使用
api.post('/api/xxx/xxx',params,hd).then(function(res)
config/index.js文件夹下
proxyTable: {
'/api': {
target: 'https://xxxxxxx.com', //测试线
changeOrigin: true, // 是否跨域
secure: true,//是否是https
pathRewrite: {
'^/api': ''
}
},
},
使用
api.post('/api/xxx/xxx',params,hd).then(function(res)