From 8debac2edf10544ff965b1a43c8d24ee67caebb1 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Sun, 29 Mar 2026 02:40:26 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BC=98=E5=8C=96=E9=98=BF=E9=87=8C?= =?UTF-8?q?=E4=BA=91cdn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/acme-client/src/client.js | 3 ++- packages/core/pipeline/src/plugin/api.ts | 4 ++-- .../plugin-aliyun/plugin/deploy-to-cdn/index.ts | 17 +++++++++-------- .../plugin/deploy-to-dcdn/index.ts | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/packages/core/acme-client/src/client.js b/packages/core/acme-client/src/client.js index b1cb07af4..3f4bbcb01 100644 --- a/packages/core/acme-client/src/client.js +++ b/packages/core/acme-client/src/client.js @@ -588,7 +588,8 @@ class AcmeClient { if (invalidStates.includes(resp.data.status)) { abort(); - throw new Error(util.formatResponseError(resp)); + this.log(`[${d}] : 检查状态 = ${resp.data.status} : ${JSON.stringify(resp.data)}`); + throw new Error("校验失败:" + util.formatResponseError(resp)); } else if (pendingStates.includes(resp.data.status)) { throw new Error(`[${d}] Operation is pending or processing(当前仍然在等待状态)`); diff --git a/packages/core/pipeline/src/plugin/api.ts b/packages/core/pipeline/src/plugin/api.ts index 73a705219..9c57d2148 100644 --- a/packages/core/pipeline/src/plugin/api.ts +++ b/packages/core/pipeline/src/plugin/api.ts @@ -379,9 +379,9 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin { targetName: string; getCertDomains: () => Promise; uploadCert: () => Promise; - deployOne: (req: { target: any; cert: any }) => Promise; + deployOne: (req: { target: CertTargetItem; cert: any }) => Promise; getDeployTargetList: (req: PageSearch) => Promise<{ list: CertTargetItem[]; total: number }>; - }): Promise<{ result: any; deployedList: any[] }> { + }): Promise<{ result: string; deployedList: string[] }> { this.logger.info("证书匹配模式部署"); const certDomains = await req.getCertDomains(); const certTargetList = await this.getAutoMatchedTargets({ diff --git a/packages/ui/certd-server/src/plugins/plugin-aliyun/plugin/deploy-to-cdn/index.ts b/packages/ui/certd-server/src/plugins/plugin-aliyun/plugin/deploy-to-cdn/index.ts index 62e4925c5..bd8f0159d 100644 --- a/packages/ui/certd-server/src/plugins/plugin-aliyun/plugin/deploy-to-cdn/index.ts +++ b/packages/ui/certd-server/src/plugins/plugin-aliyun/plugin/deploy-to-cdn/index.ts @@ -1,5 +1,5 @@ import { optionsUtils } from '@certd/basic'; -import { AbstractTaskPlugin, IsTaskPlugin, Pager, PageSearch, pluginGroups, RunStrategy, TaskInput, TaskOutput } from '@certd/pipeline'; +import { AbstractTaskPlugin, CertTargetItem, IsTaskPlugin, Pager, PageSearch, pluginGroups, RunStrategy, TaskInput, TaskOutput } from '@certd/pipeline'; import { CertApplyPluginNames, CertReader } from "@certd/plugin-cert"; import { CertInfo, createCertDomainGetterInputDefine, createRemoteSelectInputDefine } from '@certd/plugin-lib'; import { AliyunAccess } from "../../../plugin-lib/aliyun/access/index.js"; @@ -10,11 +10,12 @@ import { AliyunClient, AliyunSslClient, CasCertId } from "../../../plugin-lib/al icon: 'svg:icon-aliyun', group: pluginGroups.aliyun.key, desc: '自动部署域名证书至阿里云CDN', - default: { - strategy: { - runStrategy: RunStrategy.SkipWhenSucceed, - }, - }, + runStrategy: RunStrategy.AlwaysRun, + // default: { + // strategy: { + // runStrategy: RunStrategy.SkipWhenSucceed, + // }, + // }, }) export class DeployCertToAliyunCDN extends AbstractTaskPlugin { @TaskInput({ @@ -143,8 +144,8 @@ export class DeployCertToAliyunCDN extends AbstractTaskPlugin { uploadCert: async () => { return await sslClient.uploadCertOrGet(this.cert); }, - deployOne: async (req: { target: any, cert: any }) => { - return await this.deployOne(client, req.target, req.cert); + deployOne: async (req: { target: CertTargetItem, cert: any }) => { + return await this.deployOne(client, req.target.value, req.cert); }, getCertDomains:async ()=>{ return sslClient.getCertDomains(this.cert); diff --git a/packages/ui/certd-server/src/plugins/plugin-aliyun/plugin/deploy-to-dcdn/index.ts b/packages/ui/certd-server/src/plugins/plugin-aliyun/plugin/deploy-to-dcdn/index.ts index 5361733a9..ab39a63da 100644 --- a/packages/ui/certd-server/src/plugins/plugin-aliyun/plugin/deploy-to-dcdn/index.ts +++ b/packages/ui/certd-server/src/plugins/plugin-aliyun/plugin/deploy-to-dcdn/index.ts @@ -108,7 +108,7 @@ export class DeployCertToAliyunDCDN extends AbstractTaskPlugin { uploadCert: async () => { return await sslClient.uploadCertOrGet(this.cert); }, - deployOne: async (req: { target: any, cert: any }) => { + deployOne: async (req: { target: CertTargetItem, cert: any }) => { return await this.deployOne(client, req.target.value, req.cert); }, getCertDomains: async ()=>{