mirror of
https://github.com/certd/certd.git
synced 2026-04-24 12:27:25 +08:00
fix: 优化西部数据 500 already exists 的问题
This commit is contained in:
@@ -158,6 +158,9 @@ export class WestAccess extends BaseAccess {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (res.msg !== 'success') {
|
if (res.msg !== 'success') {
|
||||||
|
if(res.msg.includes('500 already exists')){
|
||||||
|
return res;
|
||||||
|
}
|
||||||
throw new Error(`${JSON.stringify(res.msg)}`);
|
throw new Error(`${JSON.stringify(res.msg)}`);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
@@ -253,6 +256,9 @@ token=md5(zhangsan + 5dh232kfg!* + 1554691950854)=cfcd208495d565ef66e7dff9f98764
|
|||||||
});
|
});
|
||||||
this.ctx.logger.info(`request ${url} ${method} res:${JSON.stringify(res)}`);
|
this.ctx.logger.info(`request ${url} ${method} res:${JSON.stringify(res)}`);
|
||||||
if (res.msg !== 'success' && res.result!= 200) {
|
if (res.msg !== 'success' && res.result!= 200) {
|
||||||
|
if(res.msg.includes('500 already exists')){
|
||||||
|
return res;
|
||||||
|
}
|
||||||
throw new Error(`${JSON.stringify(res.msg)}`);
|
throw new Error(`${JSON.stringify(res.msg)}`);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
@@ -73,11 +73,16 @@ export class WestDnsProviderDomain extends AbstractDnsProvider<westRecord> {
|
|||||||
}
|
}
|
||||||
//这里调用删除txt dns解析记录接口
|
//这里调用删除txt dns解析记录接口
|
||||||
|
|
||||||
|
const record_id = record?.body?.record_id;
|
||||||
|
if (!record_id) {
|
||||||
|
this.logger.info('record_id不存在');
|
||||||
|
return;
|
||||||
|
}
|
||||||
// 准备要发送到API的请求体
|
// 准备要发送到API的请求体
|
||||||
const requestBody = {
|
const requestBody = {
|
||||||
act: 'dnsrec.remove', // API动作类型
|
act: 'dnsrec.remove', // API动作类型
|
||||||
domain: domain, // 域名
|
domain: domain, // 域名
|
||||||
record_id: record.body.record_id,
|
record_id: record_id,
|
||||||
hostname: fullRecord, // 完整的记录名
|
hostname: fullRecord, // 完整的记录名
|
||||||
record_type: 'TXT', // DNS记录类型
|
record_type: 'TXT', // DNS记录类型
|
||||||
record_line: '', // 记录线路
|
record_line: '', // 记录线路
|
||||||
|
|||||||
@@ -107,12 +107,16 @@ export class WestDnsProvider extends AbstractDnsProvider<westRecord> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//这里调用删除txt dns解析记录接口
|
//这里调用删除txt dns解析记录接口
|
||||||
|
const record_id = record.data?.id;
|
||||||
|
if (!record_id) {
|
||||||
|
this.logger.info('record_id不存在');
|
||||||
|
return;
|
||||||
|
}
|
||||||
// 准备要发送到API的请求体
|
// 准备要发送到API的请求体
|
||||||
const requestBody = {
|
const requestBody = {
|
||||||
act: 'deldnsrecord', // API动作类型
|
act: 'deldnsrecord', // API动作类型
|
||||||
domain: domain, // 域名
|
domain: domain, // 域名
|
||||||
id: record.data?.id,
|
id: record_id,
|
||||||
};
|
};
|
||||||
|
|
||||||
const url = '/v2/domain/';
|
const url = '/v2/domain/';
|
||||||
|
|||||||
Reference in New Issue
Block a user