mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2024-11-01 22:20:30 +08:00
优化菜单导入
This commit is contained in:
parent
3599c8c253
commit
63e71716f9
@ -25,8 +25,8 @@ export class BaseAppEvent {
|
||||
@App()
|
||||
app: IMidwayKoaApplication;
|
||||
|
||||
@Event('onDBInit')
|
||||
async onDBInit() {
|
||||
@Event('onMenuInit')
|
||||
async onMenuInit() {
|
||||
this.checkConfig();
|
||||
this.checkKeys();
|
||||
}
|
||||
|
@ -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', {});
|
||||
}
|
||||
}
|
||||
|
@ -19,8 +19,8 @@ export class UserAppEvent {
|
||||
@App()
|
||||
app: IMidwayKoaApplication;
|
||||
|
||||
@Event('onDBInit')
|
||||
async onDBInit() {
|
||||
@Event('onMenuInit')
|
||||
async onMenuInit() {
|
||||
this.checkConfig();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user