uniapp跨域解决方案
发表于:2023-09-09 09:23:46浏览:100次
在 mainfest.json 文件中的 {} 中添加如下代码:
"h5":{
"devServer":{
"port":8080,
"disableHostCheck":true,
"proxy":{
"/api":{
"target":"http://localhost:80",
"changeOrigin":true,
"secure":false,
"pathRewrite":{
"/api":""
}
}
}
}
}
说明:假设是使用 phpstudy 运行的 http://localhost:80
栏目分类全部>