mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
fix: 修复系统级授权无法查看密钥的bug
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ALL, Body, Controller, Inject, Post, Provide, Query } from '@midwayjs/core';
|
||||
import { AccessService } from '@certd/lib-server';
|
||||
import { AccessService, Constants } from '@certd/lib-server';
|
||||
import { AccessController } from '../../pipeline/access-controller.js';
|
||||
import { checkComm } from '@certd/plus-core';
|
||||
|
||||
@@ -55,6 +55,12 @@ export class SysAccessController extends AccessController {
|
||||
return await super.define(type);
|
||||
}
|
||||
|
||||
@Post('/getSecretPlain', { summary: Constants.per.authOnly })
|
||||
async getSecretPlain(@Body(ALL) body: { id: number; key: string }) {
|
||||
const value = await this.service.getById(body.id, 0);
|
||||
return this.ok(value[body.key]);
|
||||
}
|
||||
|
||||
@Post('/accessTypeDict', { summary: 'sys:settings:view' })
|
||||
async getAccessTypeDict() {
|
||||
return await super.getAccessTypeDict();
|
||||
|
||||
@@ -45,6 +45,9 @@ export class AutoAInitSite {
|
||||
|
||||
await this.sysSettingsService.backupSecret();
|
||||
|
||||
//加载一次密钥
|
||||
await this.sysSettingsService.getSecret();
|
||||
|
||||
await this.sysSettingsService.reloadPrivateSettings();
|
||||
|
||||
// 授权许可
|
||||
|
||||
@@ -14,8 +14,6 @@ export class AutoCRegisterCron {
|
||||
@Config('cron.onlyAdminUser')
|
||||
private onlyAdminUser: boolean;
|
||||
|
||||
// @Inject()
|
||||
// echoPlugin: EchoPlugin;
|
||||
@Config('cron.immediateTriggerOnce')
|
||||
private immediateTriggerOnce = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user