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