mirror of
https://github.com/certd/certd.git
synced 2026-04-14 04:20:52 +08:00
fix(cert-plugin): 优化又拍云客户端错误处理逻辑,当域名已绑定证书时不再抛出异常。
This commit is contained in:
@@ -133,7 +133,7 @@ export abstract class CertApplyBasePlugin extends CertApplyBaseConvertPlugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否过期,默认提前35天
|
||||
* 检查是否过期,默认提前15天
|
||||
* @param expires
|
||||
* @param maxDays
|
||||
*/
|
||||
|
||||
@@ -16,7 +16,7 @@ import { PrivateKeyType } from "./dns.js";
|
||||
desc: "支持海量DNS解析提供商,推荐使用,一样的免费通配符域名证书申请,支持多个域名打到同一个证书上",
|
||||
default: {
|
||||
input: {
|
||||
renewDays: 35,
|
||||
renewDays: 15,
|
||||
forceUpdate: false,
|
||||
},
|
||||
strategy: {
|
||||
|
||||
@@ -71,11 +71,18 @@ export class UpyunClient {
|
||||
Cookie: req.cookie
|
||||
}
|
||||
});
|
||||
let errorMessage = null;
|
||||
if (res.msg?.errors?.length > 0) {
|
||||
throw new Error(JSON.stringify(res.msg));
|
||||
errorMessage = JSON.stringify(res.msg);
|
||||
}
|
||||
if(res.data?.error_code){
|
||||
throw new Error(res.data?.message);
|
||||
errorMessage = res.data?.message;
|
||||
}
|
||||
if(errorMessage){
|
||||
if (errorMessage.includes("domain has been bound to this certificate")) {
|
||||
return res;
|
||||
}
|
||||
throw new Error(errorMessage);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user