問題
HBuider 直接運行請求後臺api 接口發現會報錯
解決方法
在manifest.json 中h5 中加入
"h5" : {
"devServer": {
"port": 8000,
"disableHostCheck": true,
"proxy": {
"/api": {
"target": "域名",
"changeOrigin": true,
"secure": false
}
}
}
}
注意:域名要加http 或者https