diff --git a/core/package.json b/core/package.json index d5939fa..c03c0fa 100644 --- a/core/package.json +++ b/core/package.json @@ -1,6 +1,6 @@ { "name": "@cool-midway/core", - "version": "8.0.5", + "version": "8.0.6", "description": "cool-admin midway core", "main": "dist/index.js", "typings": "index.d.ts", diff --git a/core/src/configuration.ts b/core/src/configuration.ts index 4f78b39..8336051 100644 --- a/core/src/configuration.ts +++ b/core/src/configuration.ts @@ -87,8 +87,17 @@ export class CoolConfiguration implements ILifeCycle { // 实体与路径 const eps: CoolEps = await container.getAsync(CoolEps); eps.init(); + } + + /** + * 事件初始化 + */ + async eventInit() { this.coolEventManager.emit('onServerReady'); - this.coolEventManager.globalEmit('onServerReadyOnce', true); - // location.clean(); + const env = this.app.getEnv(); + const isMainProcess = process.env.NODE_APP_INSTANCE == '0'; + if (env == 'local' || isMainProcess) { + this.coolEventManager.globalEmit('onServerReadyOnce', true); + } } }