当前位置:网站首页>跨域问题解决方式 代理服务器
跨域问题解决方式 代理服务器
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/")
}
}
}
}
}
边栏推荐
- SRE运维解密-什么是SRE:DevOps模型的具体实践!
- The world's first mass production, with the most fixed points!How does this AVP Tier1 lead?
- 现货白银需要注意八大事项
- Why Flutter Flutter of tutorials is the best choice for business?
- Using matlab to solve the linear optimization problem based on matlab dynamic model of learning notes _11 】 【
- libnet
- 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
- Flutter教程之为什么 Flutter 是创业的最佳选择?
- 2021年数据泄露成本报告解读
- win10+cuda11.7+pytorch1.12.0安装
猜你喜欢
POE交换机全方位解读(下)
A simple understanding of TCP, learn how to shake hands, wave hands and various states
The super perfect layout has shortcut keys and background replacement
Unity 截取3D图像 与 画中画PIP的实现
Flutter教程之为什么 Flutter 是创业的最佳选择?
响应式织梦模板除尘器类网站
Shell 用法梳理总结
Unity intercepts 3D images and the implementation of picture-in-picture PIP
并查集详解
小身材有大作用——光模块寿命分析(二)
随机推荐
Creo 9.0二维草图的诊断:重叠几何
【OpenCV图像处理】 图像拼接技术
POE交换机全方位解读(下)
[Miscellaneous] How to install the specified font into the computer and then use the font in the Office software?
2015年开源大事件汇总
重新认识浏览器的渲染过程
R3LIVE论文学习(二):VIO子系统
The "interaction design" battle of the smart cockpit
HNUCM 您好中国
Free自由协议系统开发
绕任意轴旋转矩阵推导
求解同余方程 数论 扩展欧几里得
响应式织梦模板塑身瑜伽类网站
3D Semantic Segmentation - 2DPASS
利用matlab求解线性优化问题【基于matlab的动力学模型学习笔记_11】
YOLOv7改进之二十二:涨点神器——引入递归门控卷积(gnConv)
学习笔记 | uiautomation(如何)实现自动化
V8中的快慢数组(附源码、图文更易理解)
现货白银需要注意八大事项
Read FastDFS in one article