|
@@ -2,6 +2,8 @@ const path = require('path');
|
|
|
|
|
|
|
|
const isProduction = process.env.NODE_ENV === 'production';
|
|
const isProduction = process.env.NODE_ENV === 'production';
|
|
|
|
|
|
|
|
|
|
+const proxyTarget = process.env.NODE_ENV === 'local' ? 'http://api.saas.hhb.com' : 'http://api.saas.huaml.com';
|
|
|
|
|
+
|
|
|
function resolve(dir) {
|
|
function resolve(dir) {
|
|
|
return path.join(__dirname, dir);
|
|
return path.join(__dirname, dir);
|
|
|
}
|
|
}
|
|
@@ -71,17 +73,17 @@ module.exports = {
|
|
|
|
|
|
|
|
proxy: {
|
|
proxy: {
|
|
|
'/dev': {
|
|
'/dev': {
|
|
|
- target: 'http://api.saas.huaml.com',
|
|
|
|
|
|
|
+ target: proxyTarget,
|
|
|
changeOrigin: true,
|
|
changeOrigin: true,
|
|
|
pathRewrite: { '^/dev': '' }
|
|
pathRewrite: { '^/dev': '' }
|
|
|
},
|
|
},
|
|
|
'/s-dev': {
|
|
'/s-dev': {
|
|
|
- target: 'http://api.saas.huaml.com',
|
|
|
|
|
|
|
+ target: proxyTarget,
|
|
|
changeOrigin: true,
|
|
changeOrigin: true,
|
|
|
pathRewrite: { '^/s-dev': '' }
|
|
pathRewrite: { '^/s-dev': '' }
|
|
|
},
|
|
},
|
|
|
'/pro': {
|
|
'/pro': {
|
|
|
- target: 'http://api.saas.huaml.com',
|
|
|
|
|
|
|
+ target: proxyTarget,
|
|
|
changeOrigin: true,
|
|
changeOrigin: true,
|
|
|
pathRewrite: { '^/pro': '/api' }
|
|
pathRewrite: { '^/pro': '/api' }
|
|
|
}
|
|
}
|