From fb52dfbfda07613a097b8d9e4cb4075db3defdbe Mon Sep 17 00:00:00 2001 From: liangtongchuan Date: Wed, 14 Apr 2021 16:37:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E7=A8=8B=EF=BC=9A=E6=8F=90=E5=8F=96?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E7=8E=AF=E5=A2=83=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/game-server/app.ts b/game-server/app.ts index 73cce71b0..04a6bf5e4 100644 --- a/game-server/app.ts +++ b/game-server/app.ts @@ -38,6 +38,7 @@ filePath.CONFIG_DIR = '/config'; const adminfilePath = _pinus.DEFAULT_ADMIN_PATH; adminfilePath.ADMIN_FILENAME = 'adminUser'; adminfilePath.ADMIN_USER = 'config/adminUser'; +const ALL_ENVS = 'production|development|alpha|dev|isbn'; /** * 替换全局Promise * 自动解析sourcemap @@ -81,7 +82,7 @@ app.configure(function() { }); // app configuration -app.configure('production|development|alpha|dev|isbn', 'connector', function () { +app.configure(ALL_ENVS, 'connector', function () { app.set('connectorConfig', { connector: pinus.connectors.hybridconnector, @@ -106,7 +107,7 @@ app.configure('production|development|alpha|dev|isbn', 'connector', function () }); }); -app.configure('production|development|alpha|dev|isbn', 'gate', function () { +app.configure(ALL_ENVS, 'gate', function () { app.set('connectorConfig', { connector: pinus.connectors.hybridconnector, @@ -114,7 +115,7 @@ app.configure('production|development|alpha|dev|isbn', 'gate', function () { }); }); -app.configure('production|development|alpha|dev|isbn', 'gm', function () { +app.configure(ALL_ENVS, 'gm', function () { app.set('connectorConfig', { connector: pinus.connectors.hybridconnector, @@ -123,7 +124,7 @@ app.configure('production|development|alpha|dev|isbn', 'gm', function () { init();//将gm后台数据加载到gate服 }); -app.configure('production|development|alpha|dev|isbn', 'guild', function () { +app.configure(ALL_ENVS, 'guild', function () { app.set('connectorConfig', { connector: pinus.connectors.hybridconnector, @@ -131,7 +132,7 @@ app.configure('production|development|alpha|dev|isbn', 'guild', function () { }); }); -app.configure('production|development|alpha|dev|isbn', 'systimer', function () { +app.configure(ALL_ENVS, 'systimer', function () { app.set('connectorConfig', { connector: pinus.connectors.hybridconnector, @@ -165,7 +166,7 @@ export function globalErrorHandler(err: Error, msg: any, resp: any, } // app configure -app.configure('production|development|alpha|dev|isbn', function () { +app.configure(ALL_ENVS, function () { app.set(RESERVED.ERROR_HANDLER, errorHandler); app.set(RESERVED.GLOBAL_ERROR_HANDLER, globalErrorHandler); app.globalAfter((err: Error, routeRecord: RouteRecord, msg: any, session: FrontendOrBackendSession, resp: any, cb: HandlerCallback) => {