update 优化 获取用户信息getInfo接口 使用缓存数据获取

2.X
疯狂的狮子Li 2 years ago
parent 3cdd052740
commit 54cab42252

@ -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<Map<String, Object>> getInfo() {
SysUser user = userService.selectUserById(LoginHelper.getUserId());
// 角色集合
Set<String> roles = permissionService.getRolePermission(user);
// 权限集合
Set<String> permissions = permissionService.getMenuPermission(user);
LoginUser loginUser = LoginHelper.getLoginUser();
SysUser user = userService.selectUserById(loginUser.getUserId());
Map<String, Object> 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);
}

Loading…
Cancel
Save