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