✨ feat(37回调): 添加大区集中转发接口
This commit is contained in:
@@ -16,24 +16,7 @@ export default (appInfo: EggAppInfo) => {
|
||||
url: '127.0.0.1', // 内网
|
||||
pw: ''
|
||||
};
|
||||
let regions = [ // 大区数据
|
||||
{ id: 1, env: 'development', name: "测试", domain: 'http://127.0.0.1:9000' },
|
||||
];
|
||||
config.regions = regions;
|
||||
|
||||
let httpProxy: any = {};
|
||||
for(let { env, domain } of regions) {
|
||||
httpProxy[`/web/${env}/`] = {
|
||||
target: domain,
|
||||
changeOrigin: true,
|
||||
secure: true,
|
||||
pathRewrite: function(path) {
|
||||
console.log('proxy', path, path.replace(`/web/${env}/`, '/web/'))
|
||||
return path.replace(`/web/${env}/`, '/web/')
|
||||
}
|
||||
}
|
||||
}
|
||||
config.proxy = httpProxy;
|
||||
|
||||
config.decodeParm = true;
|
||||
|
||||
// the return config will combines to EggAppConfig
|
||||
|
||||
Reference in New Issue
Block a user