pull/243/head
xiaojunnuo 2024-11-06 02:20:52 +08:00
parent 8dd648f85d
commit 61b14b52d9
2 changed files with 14 additions and 32 deletions

View File

@ -1,7 +1,8 @@
import { Config, Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
import { AppKey, getPlusInfo, PlusRequestService, verify } from '@certd/plus-core';
import { AppKey, 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 {
@ -69,6 +70,18 @@ export class PlusService {
});
}
async bindUrl(subjectId: string, url: string) {
const plusRequestService = await this.getPlusRequestService();
return await plusRequestService.request({
url: '/activation/subject/urlBind',
data: {
subjectId,
appKey: AppKey,
url,
},
});
}
async register() {
const plusRequestService = await this.getPlusRequestService();
const licenseInfo: SysLicenseInfo = await this.sysSettingsService.getSetting(SysLicenseInfo);
@ -89,34 +102,4 @@ export class PlusService {
}
}
}
async bindUrl(subjectId: string, url: string) {
const plusRequestService = await this.getPlusRequestService();
return await plusRequestService.request({
url: '/activation/subject/urlBind',
data: {
subjectId,
appKey: AppKey,
url,
},
});
}
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);
}
}

View File

@ -17,7 +17,6 @@ process.env.VITE_APP_BUILD_TIME = require("dayjs")().format("YYYY-M-D HH:mm:ss")
import { theme } from "ant-design-vue";
import * as https from "node:https";
const { defaultAlgorithm, defaultSeed } = theme;
const mapToken = defaultAlgorithm(defaultSeed);