refactor: transfer

master
xiaojunnuo 2021-02-08 15:00:04 +08:00
parent 520b27e0dc
commit e41c084381
1 changed files with 14 additions and 0 deletions

View File

@ -23,6 +23,7 @@ export class Executor {
async run (options) {
logger.info('------------------- Cert-D ---------------------')
try {
this.transfer(options)
options = _.merge(createDefaultOptions(), options)
return await this.doRun(options)
} catch (e) {
@ -31,6 +32,19 @@ export class Executor {
}
}
transfer (options) {
const providers = options.accessProviders
if (_.isArray(providers)) {
const map = {}
for (const provider of providers) {
if (provider.key) {
map[provider.key] = provider
}
}
options.accessProviders = map
}
}
async doRun (options) {
// 申请证书
logger.info('任务开始')