mirror of https://github.com/certd/certd
chore: dns 域名查询输出域名列表
parent
fd5aa63ef3
commit
36a773df0b
|
@ -42,14 +42,16 @@ export class AliyunDnsProvider implements IDnsProvider {
|
||||||
async matchDomain(dnsRecord: string) {
|
async matchDomain(dnsRecord: string) {
|
||||||
const list = await this.getDomainList();
|
const list = await this.getDomainList();
|
||||||
let domain = null;
|
let domain = null;
|
||||||
|
const domainList = [];
|
||||||
for (const item of list) {
|
for (const item of list) {
|
||||||
|
domainList.push(item.DomainName);
|
||||||
if (_.endsWith(dnsRecord, item.DomainName)) {
|
if (_.endsWith(dnsRecord, item.DomainName)) {
|
||||||
domain = item.DomainName;
|
domain = item.DomainName;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!domain) {
|
if (!domain) {
|
||||||
throw new Error("can not find Domain ," + dnsRecord);
|
throw new Error(`can not find Domain :${dnsRecord} ,list: ${JSON.stringify(domainList)}`);
|
||||||
}
|
}
|
||||||
return domain;
|
return domain;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue