优化
This commit is contained in:
@@ -34,6 +34,7 @@ import org.nl.modules.system.service.VerifyService;
|
||||
|
||||
import org.nl.modules.system.service.UserService;
|
||||
import org.nl.utils.PageUtil;
|
||||
import org.nl.utils.RedisUtils;
|
||||
import org.nl.utils.RsaUtils;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
import org.nl.utils.enums.CodeEnum;
|
||||
@@ -67,6 +68,7 @@ public class UserController {
|
||||
private final DataService dataService;
|
||||
private final DeptService deptService;
|
||||
private final RoleService roleService;
|
||||
private final RedisUtils redisUtils;
|
||||
private final VerifyService verificationCodeService;
|
||||
|
||||
@ApiOperation("导出用户数据")
|
||||
@@ -145,6 +147,12 @@ public class UserController {
|
||||
if (currentLevel > optLevel) {
|
||||
throw new BadRequestException("角色权限不足,不能删除:" + userService.findById(id).getUsername());
|
||||
}
|
||||
// 删除缓存信息
|
||||
UserDto userDto = userService.findById(id);
|
||||
redisUtils.del("data::user:" + userDto.getId());
|
||||
redisUtils.del("menu::user:" + userDto.getId());
|
||||
redisUtils.del("role::auth:" + userDto.getId());
|
||||
redisUtils.del("user::username:" + userDto.getUsername());
|
||||
}
|
||||
userService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
|
||||
Reference in New Issue
Block a user