// const noProxy = process.env.NO_PROXY === 'true';
const noProxy =true;
并且:
export default (noProxy ? {
'GET /api/(.*)': apiurl+'/api/',
'POST /api/(.*)': apiurl+'/api/',
} : delay(proxy, 1000));
也尝试在webpackrc加入:
"proxy": {
"/api": {
"target": "http://192.168.1.28:8080/"
"changeOrigin": true,
"pathRewrite": { "^/api" : "" }
}
}
还是localhost,而没有转发到apiurl