From 3fb89274d932bf9636fe0242d80d2849f326a128 Mon Sep 17 00:00:00 2001 From: huoguanghua Date: Sat, 1 Apr 2023 23:01:14 +0800 Subject: [PATCH] fix bug in sys/role.ts change role to username --- src/modules/base/controller/admin/sys/role.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/base/controller/admin/sys/role.ts b/src/modules/base/controller/admin/sys/role.ts index c7f25e2..dd0d793 100644 --- a/src/modules/base/controller/admin/sys/role.ts +++ b/src/modules/base/controller/admin/sys/role.ts @@ -21,7 +21,7 @@ import { BaseSysRoleService } from '../../../service/sys/role'; pageQueryOp: { keyWordLikeFields: ['name', 'label'], where: async (ctx: Context) => { - const { userId, roleIds, role } = ctx.admin; + const { userId, roleIds, username } = ctx.admin; return [ // 超级管理员的角色不展示 ['label != :label', { label: 'admin' }], @@ -29,7 +29,7 @@ import { BaseSysRoleService } from '../../../service/sys/role'; [ '(userId=:userId or id in (:roleIds))', { userId, roleIds }, - role !== 'admin', + username !== 'admin', ], ]; },