1、manifest.json源码视图中配置
"h5" : {
"devServer": {
"disableHostCheck": true,
"proxy": {
"/tapi": {
"target": "xxx", //需要跨域请求的域名
"changeOrigin": true,
"secure": false,
"pathRewrite": {
"^/tapi": ""
}
}
}
}
}
2、请求的时候
const baseUrl='/tapi';
const login=baseUrl+'xxx'; //登录接口