在manifest.json文件映射一下;点击源码视图,h5部分加上:
"devServer" : {
"port" : 8085,
"disableHostCheck" : true,
"proxy" : {
"/api" : {
"target" : "http://api.test.com",
"ws": true,
"changeOrigin": true,
"pathRewrite": {
"^/api": ""
}
}
}
}
baseUrl : 'api'