修复权限错误问题

This commit is contained in:
阿沐 2022-06-01 20:26:44 +08:00
parent 65a3bc59d7
commit 34f53a3bd4
2 changed files with 7 additions and 2 deletions

View File

@ -128,6 +128,11 @@ public class SysUserController {
@Operation(summary = "删除")
@PreAuthorize("hasAuthority('sys:user:delete')")
public Result<String> delete(@RequestBody List<Long> idList){
Long userId = SecurityUser.getUserId();
if(idList.contains(userId)){
return Result.error("不能删除当前登录用户");
}
sysUserService.delete(idList);
return Result.ok();

View File

@ -15,7 +15,7 @@
select t3.* from sys_user_role t1
left join sys_role_menu t2 on t1.role_id = t2.role_id
left join sys_menu t3 on t2.menu_id = t3.id
where t1.user_id = #{userId} and t1.deleted = 0 and t3.deleted = 0
where t1.user_id = #{userId} and t1.deleted = 0 and t2.deleted = 0 and t3.deleted = 0
<if test="type != null">
and t3.type = #{type}
</if>
@ -26,7 +26,7 @@
select t3.authority from sys_user_role t1
left join sys_role_menu t2 on t1.role_id = t2.role_id
left join sys_menu t3 on t2.menu_id = t3.id
where t1.user_id = #{userId} and t1.deleted = 0 and t3.deleted = 0 order by t3.sort asc
where t1.user_id = #{userId} and t1.deleted = 0 and t2.deleted = 0 and t3.deleted = 0 order by t3.sort asc
</select>
<select id="getAuthorityList" resultType="string">