Merge remote-tracking branch 'origin/v2-dev' into v2-dev

This commit is contained in:
xiaojunnuo
2024-11-06 01:30:16 +08:00
2 changed files with 135 additions and 35 deletions

View File

@@ -60,14 +60,36 @@ export class PlusService {
const installInfo: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
const plusRequestService = await this.getPlusRequestService();
return await verify({
subjectId: installInfo.siteId,
subjectId: plusRequestService.subjectId,
license: licenseInfo.license,
plusRequestService: plusRequestService,
bindUrl: installInfo?.bindUrl,
});
}
async register() {
const plusRequestService = await this.getPlusRequestService();
const licenseInfo: SysLicenseInfo = await this.sysSettingsService.getSetting(SysLicenseInfo);
const installInfo: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
if (!licenseInfo?.license) {
//还没有license注册一个
const res = await plusRequestService.requestWithoutSign({
url: '/activation/subject/register',
data: {
appKey: AppKey,
subjectId: installInfo.siteId,
installTime: installInfo.installTime,
},
});
if (res.license) {
await this.updateLicense(res.license);
logger.info('站点注册成功');
}
}
}
async bindUrl(subjectId: string, url: string) {
const plusRequestService = await this.getPlusRequestService();
return await plusRequestService.request({