mirror of
https://github.com/certd/certd.git
synced 2026-07-29 16:47:36 +08:00
perf: 证书成功通知增加有效期显示
This commit is contained in:
@@ -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",
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user