当前位置:网站首页>跨域问题解决方式 代理服务器
跨域问题解决方式 代理服务器
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/")
}
}
}
}
}
边栏推荐
猜你喜欢

Free自由协议系统开发

求解同余方程 数论 扩展欧几里得

Minimized installation of debian11

Shell编程之循环语句与函数
![2022-08-03:以下go语言代码输出什么?A:2;B:3;C:1;D:0。 package main import “fmt“ func main() { slice := []i](/img/a9/6de3c2bae92d09b13b1c36e01f86c2.png)
2022-08-03:以下go语言代码输出什么?A:2;B:3;C:1;D:0。 package main import “fmt“ func main() { slice := []i

FPGA按键消抖+蜂鸣器

苹果对高通说:我4.45亿美元买下一个新园区,可能计划加快基带芯片自研

Nanoprobes Mono- Sulfo -NHS-Nanogold的使用和应用

Apple told Qualcomm: I bought a new campus for $445 million and may plan to speed up self-development of baseband chips

伦敦银最新均线分析系统怎么操作?
随机推荐
The "interaction design" battle of the smart cockpit
卡尔曼滤波器KF
A simple understanding of TCP, learn how to shake hands, wave hands and various states
直播系统聊天技术(八):vivo直播系统中IM消息模块的架构实践
小身材有大作用——光模块寿命分析(二)
3D Semantic Segmentation - 2DPASS
【每日一题】899. 有序队列
射频芯片(RFIC)的协议之5G及其调制
求解同余方程 数论 扩展欧几里得
HNUCM 您好中国
(PC+WAP)织梦模板螺钉手柄类网站
Internship: Upload method for writing excel sheet (import)
学习笔记 | uiautomation(如何)实现自动化
BPF 可移植性和 CO-RE(一次编译,到处运行)
Creo 9.0二维草图的诊断:加亮开放端点
带你造轮子,自定义一个随意拖拽可吸边的悬浮View组件
高斯推断推导
V8中的快慢数组(附源码、图文更易理解)
Unity intercepts 3D images and the implementation of picture-in-picture PIP
FPGA按键消抖+蜂鸣器