当前位置:网站首页>跨域问题解决方式 代理服务器
跨域问题解决方式 代理服务器
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/")
}
}
}
}
}
边栏推荐
- 现货白银需要注意八大事项
- Salesforce's China business may see new changes, rumors may be closing
- C语言实验十四 结构体
- Jmeter-参数化
- 电子邮件安全或面临新威胁!
- XSLT – 编辑 XML概述
- Salesforce的中国区业务可能出现新变化,传言可能正在关闭
- In V8 how arrays (with source code, picture and text easier to understand)
- 【LeetCode】最长公共子序列(动态规划)
- Super perfect version of the layout have shortcut, background replacement (solve the problem of opencv Chinese path)
猜你喜欢
随机推荐
Creo 9.0二维草图的诊断:加亮开放端点
七夕活动浪漫上线,别让网络拖慢和小姐姐的开黑时间
七夕活动浪漫上线,别让网络拖慢和小姐姐的开黑时间
LeetCode 0155. 最小栈
Shell编程之循环语句与函数
vscode插件设置——Golang开发环境配置
Install third-party packages via whl
leetcode/子串中不能有重复字符的最长子串
小身材有大作用——光模块寿命分析(二)
简单了解下 TCP,学习握手和挥手以及各种状态到底是怎么样的
JS获得URL超链接的参数值
智能座舱的「交互设计」大战
C语言实验十四 结构体
双目IMU标定kalibr
MPLS综合实验
Justin Sun: Web3.0 and the Metaverse will assist mankind to enter the online world more comprehensively
免费的公共WiFi不要乱连,遭中间人攻击了吧?
【杂项】如何将指定字体装入电脑然后能在Office软件里使用该字体?
internship:编写excel表的上传方法(导入)
[Miscellaneous] How to install the specified font into the computer and then use the font in the Office software?