chore: dns 域名查询输出域名列表

pull/68/head
xiaojunnuo 2024-01-03 11:45:58 +08:00
parent fd5aa63ef3
commit 36a773df0b
1 changed files with 3 additions and 1 deletions

View File

@ -42,14 +42,16 @@ export class AliyunDnsProvider implements IDnsProvider {
async matchDomain(dnsRecord: string) {
const list = await this.getDomainList();
let domain = null;
const domainList = [];
for (const item of list) {
domainList.push(item.DomainName);
if (_.endsWith(dnsRecord, item.DomainName)) {
domain = item.DomainName;
break;
}
}
if (!domain) {
throw new Error("can not find Domain ," + dnsRecord);
throw new Error(`can not find Domain :${dnsRecord} ,list: ${JSON.stringify(domainList)}`);
}
return domain;
}