mirror of
https://github.com/certd/certd.git
synced 2026-04-15 13:32:37 +08:00
chore:
This commit is contained in:
@@ -6,7 +6,8 @@ import { OpenKey } from '../../../modules/open/service/open-key-service.js';
|
||||
import { BaseOpenController } from '../base-open-controller.js';
|
||||
|
||||
export type CertGetReq = {
|
||||
domains: string;
|
||||
domains?: string;
|
||||
certId: number;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -25,17 +26,13 @@ export class OpenCertController extends BaseOpenController {
|
||||
const openKey: OpenKey = this.ctx.openKey;
|
||||
const userId = openKey.userId;
|
||||
if (!userId) {
|
||||
return Constants.res.openKeyError;
|
||||
throw new CodeException(Constants.res.openKeyError);
|
||||
}
|
||||
|
||||
const domains = bean.domains || query.domains;
|
||||
if (!domains) {
|
||||
throw new CodeException(Constants.res.openParamError);
|
||||
}
|
||||
const domainArr = domains.split(',');
|
||||
const res: CertInfo = await this.certInfoService.getCertInfo({
|
||||
userId,
|
||||
domains: domainArr,
|
||||
domains: bean.domains || query.domains,
|
||||
certId: bean.certId || query.certId,
|
||||
});
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user