使用vue-cli 2.9创建的项目config/index.js proxyTable: { '/UTRY':{ target:'http://192.168.0.143:9300', changeOrigin:true, pathRewrite:{ '^/UTRY':'/UTRY'
}
}
}build/webpack.dev.conf.jsdevServer:{ proxy: config.dev.proxyTable,
}axiosconst baseURL = "http://192.168.0.143:9300"const $http = axios.create({
baseURL
})xxx.vuethis.$http
.post("/UTRY/tsupport_workbench/rest/loginCtrl/getMenu")重启,删除node_modules都试过了,并没有任何代理迹象。。。控制台还是报跨域Access to XMLHttpRequest at 'http://192.168.0.143:9300/UTRY/tsupport_workbench/rest/loginCtrl/getMenu' from origin 'http://127.0.0.1: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.NetworkRequest URL: http://192.168.0.143:9300/UTRY/tsupport_workbench/rest/loginCtrl/getMenu请问该如何配置呢?
1 回答
- 1 回答
- 0 关注
- 3704 浏览
添加回答
举报
0/150
提交
取消