From fe9630d15c26ef4ad5e3263a88ff6820681de9d9 Mon Sep 17 00:00:00 2001 From: JEECG <445654970@qq.com> Date: Tue, 6 May 2025 09:24:20 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90issues/8211=E3=80=91=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=86=99=E7=9A=84=E6=9C=89=E9=97=AE=E9=A2=98?= =?UTF-8?q?--=20org/jeecg/config/firewall/interceptor/LowCodeModeIntercept?= =?UTF-8?q?or.java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/firewall/interceptor/LowCodeModeInterceptor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/firewall/interceptor/LowCodeModeInterceptor.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/firewall/interceptor/LowCodeModeInterceptor.java index 7b03a657d..9bdcbd643 100644 --- a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/firewall/interceptor/LowCodeModeInterceptor.java +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/firewall/interceptor/LowCodeModeInterceptor.java @@ -6,15 +6,12 @@ import org.apache.shiro.SecurityUtils; import org.jeecg.common.api.CommonAPI; import org.jeecg.common.api.vo.Result; import org.jeecg.common.constant.CommonConstant; -import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.util.JwtUtil; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.util.CommonUtils; import org.jeecg.common.util.SpringContextUtils; import org.jeecg.config.JeecgBaseConfig; -import org.jeecg.config.firewall.interceptor.enums.LowCodeUrlsEnum; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.AntPathMatcher; import org.springframework.web.servlet.HandlerInterceptor; import javax.annotation.Resource; @@ -70,6 +67,9 @@ public class LowCodeModeInterceptor implements HandlerInterceptor { Set hasRoles = null; if (loginUser == null) { loginUser = commonAPI.getUserByName(JwtUtil.getUserNameByToken(SpringContextUtils.getHttpServletRequest())); + } + + if (loginUser != null) { //当前登录人拥有的角色 hasRoles = commonAPI.queryUserRolesById(loginUser.getId()); }