From 63e71716f90048ee862c43f7e55b6f92f905aa8e Mon Sep 17 00:00:00 2001 From: cool Date: Wed, 24 Apr 2024 08:52:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=8F=9C=E5=8D=95=E5=AF=BC?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/base/event/app.ts | 4 ++-- src/modules/base/event/menu.ts | 6 +++++- src/modules/user/event/app.ts | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/modules/base/event/app.ts b/src/modules/base/event/app.ts index 453d790..9f75703 100644 --- a/src/modules/base/event/app.ts +++ b/src/modules/base/event/app.ts @@ -25,8 +25,8 @@ export class BaseAppEvent { @App() app: IMidwayKoaApplication; - @Event('onDBInit') - async onDBInit() { + @Event('onMenuInit') + async onMenuInit() { this.checkConfig(); this.checkKeys(); } diff --git a/src/modules/base/event/menu.ts b/src/modules/base/event/menu.ts index edcbaf1..3257b43 100644 --- a/src/modules/base/event/menu.ts +++ b/src/modules/base/event/menu.ts @@ -1,4 +1,4 @@ -import { CoolEvent, Event } from '@cool-midway/core'; +import { CoolEvent, CoolEventManager, Event } from '@cool-midway/core'; import { BaseSysMenuService } from '../service/sys/menu'; import { App, @@ -22,6 +22,9 @@ export class BaseMenuEvent { @App() app: IMidwayApplication; + @Inject() + coolEventManager: CoolEventManager; + @Event('onMenuImport') async onMenuImport(datas) { for (const module in datas) { @@ -32,5 +35,6 @@ export class BaseMenuEvent { '] module menu success \x1B[0m' ); } + this.coolEventManager.emit('onMenuInit', {}); } } diff --git a/src/modules/user/event/app.ts b/src/modules/user/event/app.ts index 54ca82d..f5ba9e1 100644 --- a/src/modules/user/event/app.ts +++ b/src/modules/user/event/app.ts @@ -19,8 +19,8 @@ export class UserAppEvent { @App() app: IMidwayKoaApplication; - @Event('onDBInit') - async onDBInit() { + @Event('onMenuInit') + async onMenuInit() { this.checkConfig(); }