perf: 查看证书增加证书详情显示,包括域名,过期时间,颁发机构,指纹等

This commit is contained in:
xiaojunnuo
2026-03-16 00:52:33 +08:00
parent 76d12d6062
commit 0b9933df1e
5 changed files with 110 additions and 3 deletions
@@ -8,6 +8,7 @@ import { logger } from "@certd/basic";
import fs from "fs";
import dayjs from "dayjs";
import { ApiTags } from "@midwayjs/swagger";
import { CertReader } from "@certd/plugin-lib";
/**
*/
@@ -159,6 +160,10 @@ export class CertInfoController extends CrudController<CertInfoService> {
await this.checkOwner(this.getService(),id,"read");
const certInfoEntity = await this.service.info(id);
const certInfo = JSON.parse(certInfoEntity.certInfo);
if (certInfo?.crt) {
const certReader = new CertReader(certInfo);
certInfo.detail = certReader.detail
}
return this.ok(certInfo);
}
@@ -42,7 +42,14 @@ export class CertController extends BaseController {
}
}
const privateVars = await this.storeService.getPipelinePrivateVars(id);
return this.ok(privateVars.cert);
const certInfo = privateVars.cert;
if (certInfo?.crt) {
const certReader = new CertReader(certInfo);
certInfo.detail = certReader.detail
}
return this.ok(certInfo);
}