perf: 优化部署到阿里云CDN插件,支持多域名,更易用

This commit is contained in:
xiaojunnuo
2024-11-05 11:38:27 +08:00
parent 77c9a7e2fa
commit 80c500f618
2 changed files with 135 additions and 35 deletions

View File

@@ -61,14 +61,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({