2024-10-14 10:57:12 +08:00
|
|
|
import { Autoload, Init, Inject, Scope, ScopeEnum } from '@midwayjs/core';
|
2024-10-14 11:41:34 +08:00
|
|
|
import { getPlusInfo, isPlus, logger } from '@certd/pipeline';
|
2024-10-14 10:57:12 +08:00
|
|
|
import { SysInstallInfo, SysSettingsService } from '@certd/lib-server';
|
|
|
|
|
import { getVersion } from '../../utils/version.js';
|
2024-10-14 11:41:34 +08:00
|
|
|
import dayjs from 'dayjs';
|
2024-10-14 10:57:12 +08:00
|
|
|
|
|
|
|
|
@Autoload()
|
|
|
|
|
@Scope(ScopeEnum.Singleton)
|
|
|
|
|
export class AutoZPrint {
|
|
|
|
|
@Inject()
|
|
|
|
|
sysSettingsService: SysSettingsService;
|
|
|
|
|
|
|
|
|
|
@Init()
|
|
|
|
|
async init() {
|
|
|
|
|
const installInfo: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
|
|
|
|
|
logger.info('=========================================');
|
|
|
|
|
logger.info('当前站点ID:', installInfo.siteId);
|
|
|
|
|
const version = await getVersion();
|
|
|
|
|
logger.info(`当前版本:${version}`);
|
2024-10-14 11:41:34 +08:00
|
|
|
const plusInfo = getPlusInfo();
|
|
|
|
|
if (isPlus()) {
|
|
|
|
|
logger.info(`授权信息:${plusInfo.vipType},${dayjs(plusInfo.expireTime).format('YYYY-MM-DD')}`);
|
|
|
|
|
}
|
2024-10-14 10:57:12 +08:00
|
|
|
logger.info('服务启动完成');
|
|
|
|
|
logger.info('=========================================');
|
|
|
|
|
}
|
|
|
|
|
}
|