修复权限错误问题
This commit is contained in:
parent
65a3bc59d7
commit
34f53a3bd4
|
@ -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();
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Reference in New Issue
Block a user