From 166d5ec55fa9fb4294d55babf6b5068505679101 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 7 Mar 2020 10:19:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AA=E4=BA=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=EF=BC=8C=E5=AF=86=E7=A0=81=E5=90=8Eredis=E4=B8=AD?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E4=BF=A1=E6=81=AF=E4=B8=8D=E4=BC=9A=E8=BF=87?= =?UTF-8?q?=E6=9C=9F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/security/service/SysPermissionService.java | 8 ++++---- .../ruoyi/framework/security/service/TokenService.java | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ruoyi/src/main/java/com/ruoyi/framework/security/service/SysPermissionService.java b/ruoyi/src/main/java/com/ruoyi/framework/security/service/SysPermissionService.java index 1bdb667..021e9a5 100644 --- a/ruoyi/src/main/java/com/ruoyi/framework/security/service/SysPermissionService.java +++ b/ruoyi/src/main/java/com/ruoyi/framework/security/service/SysPermissionService.java @@ -51,16 +51,16 @@ public class SysPermissionService */ public Set getMenuPermission(SysUser user) { - Set roles = new HashSet(); + Set perms = new HashSet(); // 管理员拥有所有权限 if (user.isAdmin()) { - roles.add("*:*:*"); + perms.add("*:*:*"); } else { - roles.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); + perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); } - return roles; + return perms; } } diff --git a/ruoyi/src/main/java/com/ruoyi/framework/security/service/TokenService.java b/ruoyi/src/main/java/com/ruoyi/framework/security/service/TokenService.java index 3ecbc00..7637ed8 100644 --- a/ruoyi/src/main/java/com/ruoyi/framework/security/service/TokenService.java +++ b/ruoyi/src/main/java/com/ruoyi/framework/security/service/TokenService.java @@ -77,8 +77,7 @@ public class TokenService { if (StringUtils.isNotNull(loginUser) && StringUtils.isNotEmpty(loginUser.getToken())) { - String userKey = getTokenKey(loginUser.getToken()); - redisCache.setCacheObject(userKey, loginUser); + refreshToken(loginUser); } }