refactor: dir with md5

master
xiaojunnuo 2021-02-26 15:25:04 +08:00
parent 8f1886a585
commit 8a24293fd7
1 changed files with 6 additions and 6 deletions

View File

@ -1,9 +1,9 @@
import dayjs from 'dayjs' import dayjs from 'dayjs'
// import crypto from 'crypto' import crypto from 'crypto'
// // eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
// function md5 (content) { function md5 (content) {
// return crypto.createHash('md5').update(content).digest('hex') return crypto.createHash('md5').update(content).digest('hex')
// } }
export class CertStore { export class CertStore {
constructor ({ store, email, domains }) { constructor ({ store, email, domains }) {
this.store = store this.store = store
@ -11,7 +11,7 @@ export class CertStore {
this.domains = domains this.domains = domains
this.domain = this.getMainDomain(this.domains) this.domain = this.getMainDomain(this.domains)
this.safetyDomain = this.getSafetyDomain(this.domain) this.safetyDomain = this.getSafetyDomain(this.domain)
this.domainDir = this.safetyDomain + '-' + this.domains.length this.domainDir = this.safetyDomain + '-' + md5(this.getDomainStr(this.domains))
// this.domainDir = this.safetyDomain // this.domainDir = this.safetyDomain
this.certsRootPath = this.store.buildKey(this.email, 'certs') this.certsRootPath = this.store.buildKey(this.email, 'certs')