防护:添加人数过多防护措施

This commit is contained in:
luying
2022-01-08 17:13:31 +08:00
parent f2c4be6443
commit 0f8a4a946e
18 changed files with 287 additions and 25 deletions

View File

@@ -25,9 +25,6 @@ export default class FooBoot implements IBoot {
}
// 如果gm使用的就是本机代理host不转发到target而只把path替换
if(this.app.config.httpProxy && this.app.config.httpProxy[`/web/${this.app.config.realEnv}/`]) {
this.app.config.httpProxy[`/web/${this.app.config.realEnv}/`].changeOrigin = false;
}
if(this.app.config.httpProxy && this.app.config.httpProxy[`/api/${this.app.config.realEnv}/`]) {
this.app.config.httpProxy[`/api/${this.app.config.realEnv}/`].changeOrigin = false;
}

View File

@@ -96,15 +96,6 @@ export default (appInfo: EggAppInfo) => {
return path.replace(`/api/${env}/`, '/api/')
}
}
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;

View File

@@ -24,7 +24,7 @@ export default (appInfo: EggAppInfo) => {
};
let regions = [ // 大区数据
{ id: 1, env: 'development', name: "测试", domain: 'http://127.0.0.1:7500' },
{ id: 1, env: 'development', name: "测试", domain: 'http://127.0.0.1:9000' },
];
config.regions = regions;
@@ -39,15 +39,6 @@ export default (appInfo: EggAppInfo) => {
return path.replace(`/api/${env}/`, '/api/')
}
}
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;