当前位置:网站首页>跨域问题解决方式 代理服务器
跨域问题解决方式 代理服务器
2022-08-04 00:05:00 【阿狸lyinshaofeng】
// const { defineConfig } = require('@vue/cli-service')
// module.exports = defineConfig({
// transpileDependencies: true
// })
// 跨域问题最常用的解决方法jsonp (可以解决get方式的跨域问题)
module.exports = { // 抛出模块
devServer:{ // 配置开发环境
proxy:{ // 代理服务
"/v1":{ // 匹配请求字符串
target:"https://m.mi.com/", // 要伪装成的服务器
changeOrigin:true, // 是否允许跨域
onProxyReq(proxyReq){
// 配置请求头信息
proxyReq.setHeader("referer","https://m.mi.com/")
}
}
}
}
}
边栏推荐
- 全面讲解 Handler机制原理解析 (小白必看)
- The problem of disorganized data output by mnn model
- 2022-08-03: What does the following go code output?A: 2; B: 3; C: 1; D: 0.package main import "fmt" func main() { slice := []i
- 并查集详解
- 查看CUDA、pytorch等的版本号
- 【杂项】通过Excel为字符串产生条码
- 现货白银需要注意八大事项
- 【深度学习】基于tensorflow的服装图像分类训练(数据集:Fashion-MNIST)
- Go编译原理系列7(Go源码调试)
- View the version number of CUDA, pytorch, etc.
猜你喜欢
随机推荐
响应式织梦模板塑身瑜伽类网站
我的祖国
Jar a key generation document database
leetcode/子串中不能有重复字符的最长子串
伦敦银最新均线分析系统怎么操作?
电子邮件安全或面临新威胁!
Talking about the future development direction of my country's industrial parks
【杂项】如何将指定字体装入电脑然后能在Office软件里使用该字体?
Internship: Upload method for writing excel sheet (import)
【MySQL —— 索引】
详谈RDMA技术原理和三种实现方式
Creo 9.0创建几何点
LeetCode 0155. 最小栈
迭代扩展卡尔曼滤波IEKF
关于mnn模型输出的数据杂乱无章问题
初始 List 接口
The Beijing E-sports Metaverse Forum was successfully held
The curl using guide
YOLOv7改进之二十二:涨点神器——引入递归门控卷积(gnConv)
Go编译原理系列7(Go源码调试)









