From bc79c10d8bfa26a3944bb68b96807739e4a79af7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E9=9B=A8=E8=88=AA?= Date: Wed, 14 Aug 2024 13:54:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8F=98=E9=87=8F=E5=90=8D=E6=94=B9?= =?UTF-8?q?=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/framework/web/config/YudaoWebAutoConfiguration.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/YudaoWebAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/YudaoWebAutoConfiguration.java index d87582147a..30fedac86c 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/YudaoWebAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/YudaoWebAutoConfiguration.java @@ -59,8 +59,8 @@ private void configurePathMatch(PathMatchConfigurer configurer, WebProperties.Ap } @Bean - public GlobalExceptionHandler globalExceptionHandler(ApiErrorLogFrameworkService ApiErrorLogFrameworkService) { - return new GlobalExceptionHandler(applicationName, ApiErrorLogFrameworkService); + public GlobalExceptionHandler globalExceptionHandler(ApiErrorLogFrameworkService apiErrorLogFrameworkService) { + return new GlobalExceptionHandler(applicationName, apiErrorLogFrameworkService); } @Bean From 5f5e8c178b4d56935d8f0c64e78e033230d99122 Mon Sep 17 00:00:00 2001 From: Vmo Date: Fri, 30 Aug 2024 06:29:01 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E5=85=B3=E9=97=AD=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E8=BF=98=E6=98=AF=E4=BC=9A=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Vmo --- .../system/service/permission/MenuServiceImpl.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java index a31f5fea38..d253cd6ca4 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/MenuServiceImpl.java @@ -140,17 +140,19 @@ private boolean isMenuDisabled(MenuDO node, Map menuMap, Set return true; } - // 1. 遍历到 parentId 为根节点,则无需判断 + // 1. 先判断自身是否禁用 + if (CommonStatusEnum.isDisable(node.getStatus())) { + disabledMenuCache.add(node.getId()); + return true; + } + + // 2. 遍历到 parentId 为根节点,则无需判断 Long parentId = node.getParentId(); if (ObjUtil.equal(parentId, ID_ROOT)) { - if (CommonStatusEnum.isDisable(node.getStatus())) { - disabledMenuCache.add(node.getId()); - return true; - } return false; } - // 2. 继续遍历 parent 节点 + // 3. 继续遍历 parent 节点 MenuDO parent = menuMap.get(parentId); if (parent == null || isMenuDisabled(parent, menuMap, disabledMenuCache)) { disabledMenuCache.add(node.getId());