mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
perf: 小优化
This commit is contained in:
+3
-1
@@ -85,7 +85,9 @@ export class AliyunDnsProvider extends AbstractDnsProvider {
|
||||
this.logger.info('添加域名解析成功:', value, value, ret.RecordId)
|
||||
return ret.RecordId
|
||||
} catch (e) {
|
||||
// e.code === 'DomainRecordDuplicate'
|
||||
if (e.code === 'DomainRecordDuplicate') {
|
||||
return
|
||||
}
|
||||
this.logger.info('添加域名解析出错', e)
|
||||
throw e
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import dnsProviders from './index.js'
|
||||
|
||||
export class DnsProviderFactory {
|
||||
static createByType (type, options) {
|
||||
try {
|
||||
const Provider = dnsProviders[type]
|
||||
return new Provider(options)
|
||||
} catch (e) {
|
||||
throw new Error('暂不支持此dnsProvider:' + type, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
import { AliyunDnsProvider } from './impl/aliyun.js'
|
||||
import { DnspodDnsProvider } from './impl/dnspod.js'
|
||||
export default {
|
||||
[AliyunDnsProvider.name()]: AliyunDnsProvider,
|
||||
[DnspodDnsProvider.name()]: DnspodDnsProvider
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
import dnsProviders from './dns-provider/index.js'
|
||||
export { DnsProviderFactory } from './dns-provider/dns-provider-factory.js'
|
||||
import { AliyunDnsProvider } from './dns-provider/aliyun.js'
|
||||
import { DnspodDnsProvider } from './dns-provider/dnspod.js'
|
||||
|
||||
export default dnsProviders
|
||||
export default {
|
||||
AliyunDnsProvider,
|
||||
DnspodDnsProvider
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import pkg from 'chai'
|
||||
import AliyunDnsProvider from '../../src/dns-provider/impl/aliyun.js'
|
||||
import AliyunDnsProvider from '../../src/dns-provider/aliyun.js'
|
||||
import { createOptions } from '../../../../test/options.js'
|
||||
import { Certd } from '../../src/index.js'
|
||||
const { expect } = pkg
|
||||
describe('AliyunDnsProvider', function () {
|
||||
it('#getDomainList', async function () {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import pkg from 'chai'
|
||||
import DnspodDnsProvider from '../../src/dns-provider/impl/dnspod.js'
|
||||
import DnspodDnsProvider from '../../src/dns-provider/dnspod.js'
|
||||
import { Certd } from '../../src/index.js'
|
||||
import { createOptions } from '../../../../test/options.js'
|
||||
const { expect } = pkg
|
||||
|
||||
Reference in New Issue
Block a user