feat(plugin): 续签电子签按AI表公式复算新合同期限
This commit is contained in:
@@ -23,6 +23,7 @@ import * as upload from '@midwayjs/upload';
|
||||
import { FileserverMonitorService } from './modules/center/service/fileserver-monitor';
|
||||
import { CenterLogService } from './modules/center/service/logstore';
|
||||
import { CenterNotifyWsService } from './modules/center/service/notify-ws';
|
||||
import { CenterRbacService } from './modules/center/service/rbac';
|
||||
|
||||
@Configuration({
|
||||
imports: [
|
||||
@@ -76,6 +77,23 @@ export class MainConfiguration {
|
||||
// 集中日志保留期清理(启动清理一次 + 周期清理,随进程启停)
|
||||
const logStore = await this.app.getApplicationContext().getAsync(CenterLogService);
|
||||
logStore.start();
|
||||
// 控制台 RBAC 幂等种子(initDB/initMenu=false,兜底超管角色、业务菜单、运行期账号)
|
||||
this.seedRbac();
|
||||
}
|
||||
|
||||
/** RBAC 种子:最多重试 3 次(等数据库连接就绪),失败仅记日志不阻断启动 */
|
||||
private seedRbac(attempt = 1) {
|
||||
this.app
|
||||
.getApplicationContext()
|
||||
.getAsync(CenterRbacService)
|
||||
.then(rbac => rbac.ensureSeed())
|
||||
.catch(e => {
|
||||
if (attempt < 3) {
|
||||
setTimeout(() => this.seedRbac(attempt + 1), 3000);
|
||||
return;
|
||||
}
|
||||
this.logger.error('[rbac] 控制台权限种子初始化失败:%s', (e as Error)?.message || e);
|
||||
});
|
||||
}
|
||||
|
||||
/** HTTP server 起来后挂载通知 WebSocket(与 8800 共用端口,执行机 notifier.js 直连) */
|
||||
|
||||
Reference in New Issue
Block a user