Skip to content

Commit

Permalink
optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
ponfee committed Apr 20, 2024
1 parent b9e3d7d commit 85bbddf
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ public static String getRequiredProperty(String key)

public static Set<String> findAllAnonymousRequestMappings() {
Set<String> 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());
}
});
Expand Down

0 comments on commit 85bbddf

Please sign in to comment.