mirror of
https://github.com/certd/certd.git
synced 2026-04-23 11:37:23 +08:00
perf: 查看证书增加证书详情显示,包括域名,过期时间,颁发机构,指纹等
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user