mirror of https://github.com/certd/certd
fix: 修复又拍云 CDN 设置证书参数和强制 HTTPS 配置报错的bug
parent
bb22f062ed
commit
7984b625ba
|
@ -54,7 +54,7 @@
|
||||||
<a-form v-else ref="twoFactorFormRef" class="user-layout-login" :model="twoFactor" v-bind="layout">
|
<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>
|
<div class="mb-10 flex flex-center">请打开您的Authenticator APP,获取动态验证码。</div>
|
||||||
<a-form-item name="verifyCode">
|
<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>
|
<template #prefix>
|
||||||
<fs-icon icon="ion:lock-closed-outline"></fs-icon>
|
<fs-icon icon="ion:lock-closed-outline"></fs-icon>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -110,30 +110,44 @@ export class UpyunDeployToCdn extends AbstractTaskPlugin {
|
||||||
this.logger.info(`登录成功`);
|
this.logger.info(`登录成功`);
|
||||||
const certId = await upyunClient.uploadCert(cookie, this.cert);
|
const certId = await upyunClient.uploadCert(cookie, this.cert);
|
||||||
this.logger.info(`上传证书成功:${certId}`);
|
this.logger.info(`上传证书成功:${certId}`);
|
||||||
await this.ctx.utils.sleep(5000);
|
|
||||||
for (const item of this.cdnList) {
|
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,
|
certificate_id: certId,
|
||||||
domain: item,
|
domain: item,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.forceHttps !== 'keep') {
|
if (this.forceHttps !== 'keep') {
|
||||||
data.force_https = Boolean(this.forceHttps);
|
data2.force_https = Boolean(this.forceHttps);
|
||||||
}
|
}
|
||||||
if (this.https !=='keep') {
|
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,
|
cookie: cookie,
|
||||||
url: "https://console.upyun.com/api/https/certificate/manager",
|
url: "https://console.upyun.com/api/https/certificate/manager",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
data: data
|
data: data2
|
||||||
});
|
});
|
||||||
this.logger.info(`部署成功:${JSON.stringify(res)}`);
|
this.logger.info(`设置证书参数成功:${JSON.stringify(res2)}`);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logger.info("部署成功");
|
this.logger.info("部署成功");
|
||||||
|
|
Loading…
Reference in New Issue