fix: 修复又拍云 CDN 设置证书参数和强制 HTTPS 配置报错的bug

pull/409/head
xiaojunnuo 2025-05-20 23:37:24 +08:00
parent bb22f062ed
commit 7984b625ba
2 changed files with 25 additions and 11 deletions

View File

@ -54,7 +54,7 @@
<a-form v-else ref="twoFactorFormRef" class="user-layout-login" :model="twoFactor" v-bind="layout">
<div class="mb-10 flex flex-center">请打开您的Authenticator APP获取动态验证码</div>
<a-form-item name="verifyCode">
<a-input ref="verifyCodeInputRef" v-model:value="twoFactor.verifyCode" placeholder="请输入动态验证码" allow-clear>
<a-input ref="verifyCodeInputRef" v-model:value="twoFactor.verifyCode" placeholder="请输入动态验证码" allow-clear @keydown.enter="handleTwoFactorSubmit">
<template #prefix>
<fs-icon icon="ion:lock-closed-outline"></fs-icon>
</template>

View File

@ -110,30 +110,44 @@ export class UpyunDeployToCdn extends AbstractTaskPlugin {
this.logger.info(`登录成功`);
const certId = await upyunClient.uploadCert(cookie, this.cert);
this.logger.info(`上传证书成功:${certId}`);
await this.ctx.utils.sleep(5000);
for (const item of this.cdnList) {
const data :any= {
this.logger.info(`开始部署证书:${item}`);
const data1 :any= {
crt_id: certId,
domain_name: item,
}
const res1=await upyunClient.doRequest({
cookie: cookie,
url: "https://console.upyun.com/api/https/migrate/domain",
method: "POST",
data: data1
});
this.logger.info(`设置证书成功:${JSON.stringify(res1)}`);
const data2 :any= {
certificate_id: certId,
domain: item,
}
if (this.forceHttps !== 'keep') {
data.force_https = Boolean(this.forceHttps);
data2.force_https = Boolean(this.forceHttps);
}
if (this.https !=='keep') {
data.https = Boolean(this.https);
data2.https = Boolean(this.https);
}
this.logger.info(`开始部署证书:${item}`);
const res = await upyunClient.doRequest({
this.logger.info(`设置证书参数:${JSON.stringify(data2)}`);
const res2 = await upyunClient.doRequest({
cookie: cookie,
url: "https://console.upyun.com/api/https/certificate/manager",
method: "POST",
data: data
data: data2
});
this.logger.info(`部署成功:${JSON.stringify(res)}`);
this.logger.info(`设置证书参数成功:${JSON.stringify(res2)}`);
}
this.logger.info("部署成功");