mirror of https://github.com/certd/certd
chore:
parent
3460d3ddca
commit
ae816e614c
|
@ -6,10 +6,10 @@
|
||||||
plus:
|
plus:
|
||||||
server:
|
server:
|
||||||
baseUrl: 'https://api.ai.handsfree.work'
|
baseUrl: 'https://api.ai.handsfree.work'
|
||||||
#typeorm:
|
typeorm:
|
||||||
# dataSource:
|
dataSource:
|
||||||
# default:
|
default:
|
||||||
# database: './data/db1.sqlite'
|
database: './data/db2.sqlite'
|
||||||
#account:
|
#account:
|
||||||
# server:
|
# server:
|
||||||
# baseUrl: 'http://127.0.0.1:1017/subject'
|
# baseUrl: 'http://127.0.0.1:1017/subject'
|
||||||
|
|
|
@ -47,28 +47,24 @@ export class PlusService {
|
||||||
}
|
}
|
||||||
licenseInfo.license = license;
|
licenseInfo.license = license;
|
||||||
await this.sysSettingsService.saveSetting(licenseInfo);
|
await this.sysSettingsService.saveSetting(licenseInfo);
|
||||||
await this.verify();
|
const verifyRes = await this.verify();
|
||||||
}
|
|
||||||
async verify() {
|
|
||||||
const licenseInfo: SysLicenseInfo = await this.sysSettingsService.getSetting(SysLicenseInfo);
|
|
||||||
const installInfo: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
|
|
||||||
|
|
||||||
if (!licenseInfo.license) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const verifyRes = await verify({
|
|
||||||
subjectId: installInfo.siteId,
|
|
||||||
license: licenseInfo.license,
|
|
||||||
plusRequestService: this.plusRequestService,
|
|
||||||
bindUrl: installInfo?.bindUrl,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!verifyRes.isPlus) {
|
if (!verifyRes.isPlus) {
|
||||||
const message = verifyRes.message || '授权码校验失败';
|
const message = verifyRes.message || '授权码校验失败';
|
||||||
logger.error(message);
|
logger.error(message);
|
||||||
throw new Error(message);
|
throw new Error(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
async verify() {
|
||||||
|
const licenseInfo: SysLicenseInfo = await this.sysSettingsService.getSetting(SysLicenseInfo);
|
||||||
|
const installInfo: SysInstallInfo = await this.sysSettingsService.getSetting(SysInstallInfo);
|
||||||
|
|
||||||
|
return await verify({
|
||||||
|
subjectId: installInfo.siteId,
|
||||||
|
license: licenseInfo.license,
|
||||||
|
plusRequestService: this.plusRequestService,
|
||||||
|
bindUrl: installInfo?.bindUrl,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async bindUrl(subjectId: string, url: string) {
|
async bindUrl(subjectId: string, url: string) {
|
||||||
return await this.plusRequestService.request({
|
return await this.plusRequestService.request({
|
||||||
|
|
Loading…
Reference in New Issue