uni-app
uni-app copied to clipboard
请求添加proxy代理功能
新功能描述 简洁描述你希望补充完善的增强功能 本地开发H5的时候,请求接口会存在跨域,能否加一个
proxyTable: {
"/api": {
target: "http://xxx.com",
// secure: true,
cookieDomainRewrite: "localhost:8080",
changeOrigin: true,
pathRewrite: {
"^/api": "/api"
}
}
},
尝试方案 目前用的fiddler/charles解决的
manifest.json
h5配置下面是可以配置 跨域的
"h5": {
"title": "",
"router": {
"mode": "history",
"base": "/"
},
"devServer": {
"https": false,
"port": 8089,
"disableHostCheck": true,
"proxy": {
"/api/*": {
"target": "",
"changeOrigin": true,
"secure": true,
"pathRewrite": {
"/api": "/"
}
}
}
}
}
thx 我试试