Vue-cli proxyTable 解决开发环境的跨域问题

xiaoxiao2021-02-28  75

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.csdn.net/zgrkaka/article/details/62230507

转载请注明原文地址: https://www.6miu.com/read-77217.html

最新回复(0)