perf: 检查cname是否正确配置

This commit is contained in:
xiaojunnuo
2024-10-09 02:34:28 +08:00
parent 9498d189e4
commit b5d8935159
36 changed files with 321 additions and 190 deletions
@@ -107,16 +107,23 @@ export class AliyunDnsProvider extends AbstractDnsProvider {
try {
const ret = await this.client.request('AddDomainRecord', params, requestOption);
this.logger.info('添加域名解析成功:', value, value, ret.RecordId);
this.logger.info('添加域名解析成功:', JSON.stringify(options), ret.RecordId);
return ret.RecordId;
} catch (e: any) {
if (e.code === 'DomainRecordDuplicate') {
return;
}
this.logger.info('添加域名解析出错', e);
throw e;
this.resolveError(e, options);
}
}
resolveError(e: any, req: CreateRecordOptions) {
if (e.Message.indexOf('The specified domain name does not exist') > -1) {
throw new Error(`阿里云账号中不存在此域名:${req.domain}`);
}
throw e;
}
async removeRecord(options: RemoveRecordOptions<any>): Promise<any> {
const { fullRecord, value } = options.recordReq;
const record = options.recordRes;