fix: 修复系统级授权无法查看密钥的bug

This commit is contained in:
xiaojunnuo
2024-12-26 23:15:35 +08:00
parent 00dc226bd2
commit 8644348fc4
6 changed files with 55 additions and 18 deletions
@@ -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();