diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java index 5c69b772..8e22a27d 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -416,10 +416,9 @@ public class SysUserServiceImpl implements ISysUserService, UserService { public void insertUserPost(SysUserBo user, boolean clear) { Long[] posts = user.getPostIds(); if (ArrayUtil.isNotEmpty(posts)) { - Long userId = LoginHelper.getUserId(); if (clear) { // 删除用户与岗位关联 - userPostMapper.delete(new LambdaQueryWrapper().eq(SysUserPost::getUserId, userId)); + userPostMapper.delete(new LambdaQueryWrapper().eq(SysUserPost::getUserId, user.getUserId())); } // 新增用户与岗位管理 List list = StreamUtils.toList(List.of(posts), postId -> {