mirror of
https://github.com/certd/certd.git
synced 2026-07-14 01:17:31 +08:00
4755216505
refactor(ui): 将分散的auto-*模块整合为统一命名的auto-register模块 perf(plugin-cert): 增强EAB授权功能,支持账号私钥刷新和类型选择 test: 添加EAB授权服务和ACME账号配置的单元测试 docs: 更新AGENTS.md补充ACME/EAB使用注意事项 chore: 统一各package.json中的测试脚本配置
21 lines
605 B
TypeScript
21 lines
605 B
TypeScript
import { logger, utils } from '@certd/basic';
|
|
import { UserSuiteService } from '@certd/commercial-core';
|
|
import { Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
|
|
|
|
@Provide()
|
|
@Scope(ScopeEnum.Request, { allowDowngrade: true })
|
|
export class AutoMitterRegister {
|
|
@Inject()
|
|
userSuiteService: UserSuiteService;
|
|
|
|
async init() {
|
|
await this.registerOnNewUser();
|
|
}
|
|
async registerOnNewUser() {
|
|
utils.mitter.on('register', async (req: { userId: number }) => {
|
|
logger.info('register event', req.userId);
|
|
await this.userSuiteService.presentGiftSuite(req.userId);
|
|
});
|
|
}
|
|
}
|