diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java index a04f81fe..1e1a8d76 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java @@ -234,6 +234,7 @@ public class SysRoleServiceImpl implements ISysRoleService { SysRole role = BeanUtil.toBean(bo, SysRole.class); // 新增角色信息 baseMapper.insert(role); + bo.setRoleId(role.getRoleId()); return insertRoleMenu(bo); } 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 1628d5fc..a503a980 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 @@ -284,6 +284,7 @@ public class SysUserServiceImpl implements ISysUserService, UserService { SysUser sysUser = BeanUtil.copyProperties(user, SysUser.class); // 新增用户信息 int rows = baseMapper.insert(sysUser); + user.setUserId(sysUser.getUserId()); // 新增用户岗位关联 insertUserPost(user); // 新增用户与角色管理