diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java index 57d562fc..c8f63274 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java @@ -330,9 +330,7 @@ public class SysUserServiceImpl implements ISysUserService, UserService { @Override @Transactional(rollbackFor = Exception.class) public void insertUserAuth(Long userId, Long[] roleIds) { - userRoleMapper.delete(new LambdaQueryWrapper() - .eq(SysUserRole::getUserId, userId)); - insertUserRole(userId, roleIds, false); + insertUserRole(userId, roleIds, true); } /**