配置
/manifest.json
"devServer" : {
"https" : false,
"port" : 7101,
"proxy": {
"/api": {
"target": "https://域名",
"changeOrigin": true,
"secure": false,
"pathRewrite":{"^/api":""}
}
}
},
接口调取
uni.request({
url: '/api/接口',
method: 'POST',
success:ret=>{
console.log(ret)
}
})