mirror of
https://github.com/certd/certd.git
synced 2026-04-24 20:57:26 +08:00
chore: dns 域名查询输出域名列表
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user