系统:停服维护逻辑

This commit is contained in:
luying
2021-07-15 14:31:29 +08:00
parent 352aecfb56
commit 0028c9b992
26 changed files with 348 additions and 50 deletions

View File

@@ -2,12 +2,14 @@
// Do not modify this file!!!!!!!!!
import 'egg';
import ExportCheckMainten from '../../../app/middleware/checkMainten';
import ExportGmTokenParser from '../../../app/middleware/gmTokenParser';
import ExportParmsDecode from '../../../app/middleware/parmsDecode';
import ExportTokenParser from '../../../app/middleware/tokenParser';
declare module 'egg' {
interface IMiddleware {
checkMainten: typeof ExportCheckMainten;
gmTokenParser: typeof ExportGmTokenParser;
parmsDecode: typeof ExportParmsDecode;
tokenParser: typeof ExportTokenParser;

View File

@@ -7,6 +7,7 @@ type AnyFunc<T = any> = (...args: any[]) => T;
type CanExportFunc = AnyFunc<Promise<any>> | AnyFunc<IterableIterator<any>>;
type AutoInstanceType<T, U = T extends CanExportFunc ? T : T extends AnyFunc ? ReturnType<T> : T> = U extends AnyClass ? InstanceType<U> : U;
import ExportAuth from '../../../app/service/Auth';
import ExportGame from '../../../app/service/Game';
import ExportTest from '../../../app/service/Test';
import ExportTurboCore from '../../../app/service/TurboCore';
import ExportUtils from '../../../app/service/Utils';
@@ -14,6 +15,7 @@ import ExportUtils from '../../../app/service/Utils';
declare module 'egg' {
interface IService {
auth: AutoInstanceType<typeof ExportAuth>;
game: AutoInstanceType<typeof ExportGame>;
test: AutoInstanceType<typeof ExportTest>;
turboCore: AutoInstanceType<typeof ExportTurboCore>;
utils: AutoInstanceType<typeof ExportUtils>;