mirror of
https://github.com/certd/certd.git
synced 2026-04-24 12:27:25 +08:00
fix: 修复系统级授权无法查看密钥的bug
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Init, Inject, Provide, Scope, ScopeEnum } from '@midwayjs/core';
|
||||
import crypto from 'crypto';
|
||||
import { SysPrivateSettings, SysSettingsService } from '../../../system/index.js';
|
||||
import { SysSecret, SysSettingsService } from '../../../system/index.js';
|
||||
|
||||
/**
|
||||
* 授权
|
||||
@@ -15,8 +15,8 @@ export class EncryptService {
|
||||
|
||||
@Init()
|
||||
async init() {
|
||||
const privateInfo: SysPrivateSettings = await this.sysSettingService.getSetting(SysPrivateSettings);
|
||||
this.secretKey = Buffer.from(privateInfo.encryptSecret, 'base64');
|
||||
const secret: SysSecret = await this.sysSettingService.getSecret();
|
||||
this.secretKey = Buffer.from(secret.encryptSecret, 'base64');
|
||||
}
|
||||
|
||||
// 加密函数
|
||||
|
||||
Reference in New Issue
Block a user