Vue-cli proxyTable 解决开发环境的跨域问题
1.修改config文件里index.js的proxyTable
//方法
proxyTable: {
'/vue': {
//请求的地址是ahttp://test.php.com/vue/
target: 'http://test.php.com/vue/',
changeOrigin: true,
pathRewrite: {
'^/vue': ''
}
}
},
官方文档:https://vuejs-templates.github.io/webpack/proxy.html
参考文件:http://blog.youkuaiyun.com/zgrkaka/article/details/62230507