diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java index 9708c6ce..0bc92506 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysUserController.java @@ -20,6 +20,7 @@ import com.ruoyi.common.satoken.utils.LoginHelper; import com.ruoyi.system.api.domain.SysDept; import com.ruoyi.system.api.domain.SysRole; import com.ruoyi.system.api.domain.SysUser; +import com.ruoyi.system.api.model.LoginUser; import com.ruoyi.system.domain.vo.SysUserExportVo; import com.ruoyi.system.domain.vo.SysUserImportVo; import com.ruoyi.system.listener.SysUserImportListener; @@ -110,15 +111,12 @@ public class SysUserController extends BaseController { */ @GetMapping("getInfo") public R> getInfo() { - SysUser user = userService.selectUserById(LoginHelper.getUserId()); - // 角色集合 - Set roles = permissionService.getRolePermission(user); - // 权限集合 - Set permissions = permissionService.getMenuPermission(user); + LoginUser loginUser = LoginHelper.getLoginUser(); + SysUser user = userService.selectUserById(loginUser.getUserId()); Map ajax = new HashMap<>(); ajax.put("user", user); - ajax.put("roles", roles); - ajax.put("permissions", permissions); + ajax.put("roles", loginUser.getRolePermission()); + ajax.put("permissions", loginUser.getMenuPermission()); return R.ok(ajax); }