管理员删除时,管理员角色没有同步删除问题处理

This commit is contained in:
Chopper 2021-08-27 16:25:37 +08:00
parent 771f9668ce
commit cdfdf483d6
2 changed files with 6 additions and 1 deletions

View File

@ -17,7 +17,7 @@ public enum ResultCode {
/**
* 失败返回码
*/
ERROR(400, "业务异常,请核对问题后进行重试"),
ERROR(400, "服务器繁忙,请稍后重试"),
/**
* 失败返回码

View File

@ -236,6 +236,11 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
* @param roles 角色id集合
*/
private void updateRole(String userId, List<String> roles) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("user_id", userId);
userRoleService.remove(queryWrapper);
if (roles.isEmpty() || roles == null) {
return;
}