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) {
 | 
			
		||||
    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;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue