mirror of
https://github.com/certd/certd.git
synced 2026-04-23 11:37:23 +08:00
perf: 检查cname是否正确配置
This commit is contained in:
+9
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user