uniapp 跨域 报错提示 Access to XMLHttpRequest at
时间:2020-07-08 18:53:13
收藏:0
阅读:2321
错误提示
Access to XMLHttpRequest at`
manifest.json文件修改
"h5": {
"devServer": {
"port": 8000,
"disableHostCheck": true,
"proxy": {
"/XXX": {
"target": "http://域名",
"changeOrigin": true,
"secure": false,
"pathRewrite":{"^/XXX":""}
}
}
}
}
http请求
uni.request({
url: ‘/XXX/具体方法‘,
data:{
id: 123
},
success: (res) => {
console.log(res.data);
}
});
*XXX要相互对应原文:https://www.cnblogs.com/dreamsails/p/13268424.html
评论(0)