// 配置跨域请求
devServer: {
port: 8080,
host: ‘localhost’,
open: true,
https: false,
proxy: {
‘/api’: {
target: ‘http://需要请求的地址/’,
ws: true,
changeOrigin: true,
pathRewrite: {
‘^/api’: ‘’
}
}
}
相关文章
- Access to XMLHttpRequest at‘httplocalhost跨域问题解决
- 关于vue本地与发布线上跨域问题解决
- 跨域请求常见错误及解决:No ‘Access-Control-Allow-Origin‘ header is present on the requested resource
- gateway跨域问题解决方法
- vue2 前后端分离项目ajax跨域session问题解决
- uni-app H5跨域问题解决方案(CORS、Cross-Origin)
- [跨域问题]ssm+vue前后台分离跨域问题解决方法
- PHP跨域问题解决方案
- uniapp APP端使用html2canvas截图分享小程序卡片图片模糊、跨域等问题解决
- nginx解决跨域,Access to XMLHttpRequest at ‘xx‘ from origin ‘xx‘ has been blocked by CORS policy