perf: 证书成功通知增加有效期显示

This commit is contained in:
xiaojunnuo
2026-07-28 19:22:12 +08:00
parent 8cbca5761e
commit f1b67049d1
4 changed files with 12 additions and 8 deletions
@@ -76,7 +76,7 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
this.clearLastStatus();
if (this.successNotify) {
await this.sendSuccessNotify();
await this.sendSuccessNotify(cert);
}
} else {
throw new Error("申请证书失败");
@@ -165,12 +165,14 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
nextUpdateDays: leftDays - maxDays,
};
}
async sendSuccessNotify() {
async sendSuccessNotify(certReader: CertReader) {
this.logger.info("发送证书申请成功通知");
const url = await this.ctx.urlService.getPipelineDetailUrl(this.pipeline.id, this.ctx.runtime.id);
const body: NotificationBody = {
title: `证书申请成功【${this.pipeline.title}`,
content: `域名:${this.domains.join(",")}`,
content: `域名:${this.domains.join(",")}\n
证书有效期:${dayjs(certReader.expires).format("YYYY-MM-DD HH:mm:ss")}\n
`,
url: url,
notificationType: "certApplySuccess",
};