VUE axios使用方法与跨域问题解决
'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. 前后端数据交互本地代理跨域问题,在本地localhost访问接口是要跨域的,浏览器的安全策略报错,需要在webpack配置proxyTableconfig/index.js module.exports = { dev: { // Paths assetsSubDirectory: 'static', assetsPublicPath: '/', proxyTable: { '/api': { target: 'http://www.centby.com',//设置你调用的接口域名和端口号 别忘了加http changeOrigin: true,//如果需要跨域 pathRewrite: { ...



