当前位置:网站首页>Uni app cross domain configuration
Uni app cross domain configuration
2022-07-26 02:20:00 【zjLOVEcyj】
uni-app Cross domain configuration
Create a new configuration file under the project root path vue.config.js
module.exports = {
devServer:{
port:'8080',
disableHostCheck:true,
proxy:{
'/api':{
target:'https://www.uinav.com/',
changeOrigin:true,
pathRewrite:{
'^/api': '/api'
}
}
}
}
}
- port Is the browser running port
- /api Is to configure the cross domain interface prefix
- target Is the server address to be forwarded , That is, the actual requested server address
- changeOrigin Whether to change the source , If set to true If so, I will send the request header Of host Replace with target, But in the browser F12 It will not be replaced during the inspection , Only used on back-end servers request.header To see host Replacement , The browser side will not display the replacement
- pathRewrite Path rewriting , Generally, the differences manually added by the front end will be eliminated , If the front end does not use the prefix set by itself, there is no need to set
边栏推荐
- 1. Mx6ul core module serial -iot-6ulx core module brief introduction (I)
- obsidian移动端PC段同步
- [xxl-job] xxl-job learning
- Quick start of adding, deleting, modifying and checking business
- [C language brush leetcode] 146. LRU cache (m)
- 2022-07-17
- The third question of leetcode 302 weekly Games -- query the number with the smallest k after cutting the number
- Advantages of composition API
- 数仓:银行业数仓的分层架构实践
- Navica tool imports remote MySQL into local MySQL database
猜你喜欢

What can EAM system help enterprises do?

【2020】【论文笔记】磁控溅射法生长Bi2Te3/CoFeB双层异质结——

(CVPR 2019) GSPN: Generative Shape Proposal Network for 3D Instance Segmentation in Point Cloud
![[leetcode] 32. Longest valid bracket](/img/5e/45bb0b1ca3d9e429c6c5cf5c4c93ae.png)
[leetcode] 32. Longest valid bracket

微信小程序解密并拆包获取源码教程

c# 单元测试

Error reporting caused by local warehouse

1. Mx6ul core module uses serial EMMC read / write test (IV)

I.MX6UL核心模块使用连载-TF卡读写测试 (五)

I.MX6UL核心模块使用连载-eMMC读写测试 (四)
随机推荐
Adruino 基础实验学习(一)
Prometheus + redis exporter + grafana monitor redis service
ggplot2学习总结
U++ common type conversion and common forms and proxies of lambda
Ti AM335X工控模块使用beaglebone(bbb)的Debian系统
17_表单数据
[cloud native] 4.1 Devops foundation and Practice
由一个数据增量处理问题看到技术人员的意识差距
一款可插拔的AM335X工控模块板载wifi模块
c# 单元测试
【2019】【论文笔记】基于超材料可调谐THz宽频吸收——
The third question of leetcode 302 weekly Games -- query the number with the smallest k after cutting the number
I.MX6UL核心模块使用连载-USB接口测试 (六)
I.MX6UL核心模块使用连载-触摸屏校准 (九)
Prometheus + process exporter + grafana monitor the resource usage of the process
Li Kou daily question - day 39 -67. Binary sum
obsidian移动端PC段同步
What are the functions of cloud notes, and how do browsers add cloud note plug-ins
18.删除链表的倒数第n个节点
I.MX6UL核心模块使用连载-nand flash读写测试 (三)