新增 onServerReadyOnce 只触发一次的事件

This commit is contained in:
COOL 2025-05-21 11:32:09 +08:00
parent 87bcda844e
commit 61e613bd4a
2 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@cool-midway/core",
"version": "8.0.4",
"version": "8.0.5",
"description": "cool-admin midway core",
"main": "dist/index.js",
"typings": "index.d.ts",

View File

@ -50,6 +50,7 @@ export class CoolConfiguration implements ILifeCycle {
async onReady(container: IMidwayContainer) {
this.coolEventManager.emit('onReady');
this.coolEventManager.globalEmit('onReadyOnce', true);
// 处理模块配置
await container.getAsync(CoolModuleConfig);
// 常用函数处理
@ -87,6 +88,7 @@ export class CoolConfiguration implements ILifeCycle {
const eps: CoolEps = await container.getAsync(CoolEps);
eps.init();
this.coolEventManager.emit('onServerReady');
this.coolEventManager.globalEmit('onServerReadyOnce', true);
// location.clean();
}
}