优化菜单导入

This commit is contained in:
cool 2024-04-24 08:52:50 +08:00
parent 3599c8c253
commit 63e71716f9
3 changed files with 9 additions and 5 deletions

View File

@ -25,8 +25,8 @@ export class BaseAppEvent {
@App()
app: IMidwayKoaApplication;
@Event('onDBInit')
async onDBInit() {
@Event('onMenuInit')
async onMenuInit() {
this.checkConfig();
this.checkKeys();
}

View File

@ -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', {});
}
}

View File

@ -19,8 +19,8 @@ export class UserAppEvent {
@App()
app: IMidwayKoaApplication;
@Event('onDBInit')
async onDBInit() {
@Event('onMenuInit')
async onMenuInit() {
this.checkConfig();
}