fix: 非超级管理员限制无权限查看超级管理员账号的问题修复
This commit is contained in:
@@ -24,9 +24,18 @@
|
||||
LEFT JOIN sys_user_role sur ON u.id = sur.user_id
|
||||
LEFT JOIN sys_role r ON sur.role_id = r.id
|
||||
<where>
|
||||
u.is_deleted = 0 AND u.username != 'root'
|
||||
<!-- 超级管理员不显示在列表 -->
|
||||
AND r.code != '${@com.youlai.boot.common.constant.SystemConstants@ROOT_ROLE_CODE}'
|
||||
u.is_deleted = 0
|
||||
<if test="!queryParams.isRoot">
|
||||
AND NOT EXISTS (
|
||||
SELECT
|
||||
1
|
||||
FROM sys_user_role sur
|
||||
INNER JOIN sys_role r ON sur.role_id = r.id
|
||||
WHERE
|
||||
sur.user_id = u.id
|
||||
AND r.code = '${@com.youlai.boot.common.constant.SystemConstants@ROOT_ROLE_CODE}'
|
||||
)
|
||||
</if>
|
||||
<if test='queryParams.keywords!=null and queryParams.keywords.trim() neq ""'>
|
||||
AND (
|
||||
u.username LIKE CONCAT('%',#{queryParams.keywords},'%')
|
||||
@@ -188,6 +197,17 @@
|
||||
LEFT JOIN sys_dept d ON u.dept_id = d.id
|
||||
<where>
|
||||
u.is_deleted = 0
|
||||
<if test="!isRoot">
|
||||
AND NOT EXISTS (
|
||||
SELECT
|
||||
1
|
||||
FROM sys_user_role sur
|
||||
INNER JOIN sys_role r ON sur.role_id = r.id
|
||||
WHERE
|
||||
sur.user_id = u.id
|
||||
AND r.code = '${@com.youlai.boot.common.constant.SystemConstants@ROOT_ROLE_CODE}'
|
||||
)
|
||||
</if>
|
||||
<if test='keywords!=null and keywords.trim() neq ""'>
|
||||
AND (u.username LIKE CONCAT('%',#{keywords},'%')
|
||||
OR u.nickname LIKE CONCAT('%',#{keywords},'%')
|
||||
|
||||
Reference in New Issue
Block a user