mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2025-12-11 00:22:49 +00:00
app参数配置控制
This commit is contained in:
parent
32a261700b
commit
9a5d42c5bf
@ -15,6 +15,8 @@ export default () => {
|
||||
globalMiddlewares: [BaseAuthorityMiddleware, BaseLogMiddleware],
|
||||
// 模块加载顺序,默认为0,值越大越优先加载
|
||||
order: 10,
|
||||
// app参数配置允许读取的key
|
||||
allowKeys: [],
|
||||
// jwt 生成解密token的
|
||||
jwt: {
|
||||
// 单点登录
|
||||
|
||||
@ -24,14 +24,21 @@ export class BaseAppCommController extends BaseController {
|
||||
@Inject()
|
||||
ctx: Context;
|
||||
|
||||
@Inject('module.base.allowKeys')
|
||||
allowKeys: string[];
|
||||
|
||||
@Inject()
|
||||
eps: CoolEps;
|
||||
|
||||
@Inject()
|
||||
baseSysParamService: BaseSysParamService;
|
||||
|
||||
@CoolTag(TagTypes.IGNORE_TOKEN)
|
||||
@Get('/param', { summary: '参数配置' })
|
||||
async param(@Query('key') key: string) {
|
||||
if (!this.allowKeys.indexOf(key)) {
|
||||
return this.fail('非法操作');
|
||||
}
|
||||
return this.ok(await this.baseSysParamService.dataByKey(key));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user