From 85bbddf0849d435d81feecbee6258b13eeedc51a Mon Sep 17 00:00:00 2001 From: Ponfee Date: Sat, 20 Apr 2024 13:15:01 +0800 Subject: [PATCH] optimize code --- .../java/com/ruoyi/common/utils/spring/SpringUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java b/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java index bb546c01a..18d33ec01 100644 --- a/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java +++ b/disjob-admin/ruoyi-common/src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java @@ -163,10 +163,10 @@ public static String getRequiredProperty(String key) public static Set findAllAnonymousRequestMappings() { Set anonymousUrls = new HashSet<>(); - RequestMappingHandlerMapping mappings = applicationContext.getBean("requestMappingHandlerMapping", RequestMappingHandlerMapping.class); - mappings.getHandlerMethods().forEach((requestMappingInfo, handlerMethod) -> { + RequestMappingHandlerMapping mapping = applicationContext.getBean("requestMappingHandlerMapping", RequestMappingHandlerMapping.class); + mapping.getHandlerMethods().forEach((requestMappingInfo, handlerMethod) -> { if (getAnnotation(handlerMethod, Anonymous.class) != null) { - // #getPatternValues()会包含:`/system/menu/add/{parentId}` + // #getPatternValues()会包含占位符路径:`/system/menu/add/{parentId}` anonymousUrls.addAll(requestMappingInfo.getDirectPaths()); } });