chore: 整理依赖

This commit is contained in:
xiaojunnuo
2024-11-06 01:17:36 +08:00
parent 77c9a7e2fa
commit 80f8fd49f1
70 changed files with 119 additions and 5990 deletions

View File

@@ -1,8 +1,7 @@
import { Config, Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
import { AppKey, PlusRequestService, verify } from '@certd/plus-core';
import { AppKey, getPlusInfo, PlusRequestService, verify } from '@certd/plus-core';
import { logger } from '@certd/basic';
import { SysInstallInfo, SysLicenseInfo, SysSettingsService } from '../../settings/index.js';
@Provide()
@Scope(ScopeEnum.Singleton)
export class PlusService {
@@ -80,4 +79,22 @@ export class PlusService {
},
});
}
async register() {
if (getPlusInfo().secret) {
return;
}
const plusRequestService = await this.getPlusRequestService();
const installInfo: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
const res = await plusRequestService.requestWithoutSign({
url: '/activation/subject/register',
method: 'post',
data: {
appKey: AppKey,
subjectId: installInfo.siteId,
installTime: installInfo.installTime,
},
});
await this.updateLicense(res.license);
}
}