| | |
| | | import org.springframework.web.method.HandlerMethod; |
| | | import org.springframework.web.servlet.mvc.method.RequestMappingInfo; |
| | | import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; |
| | | import org.springframework.web.util.pattern.PathPattern; |
| | | |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; |
| | | |
| | | /** |
| | | * 自定义的 Spring Security 配置适配器实现 |
| | |
| | | return webProperties.getAppApi().getPrefix() + url; |
| | | } |
| | | |
| | | @SuppressWarnings("removal") |
| | | private Multimap<HttpMethod, String> getPermitAllUrlsFromAnnotations() { |
| | | Multimap<HttpMethod, String> result = HashMultimap.create(); |
| | | // 获得接口对应的 HandlerMethod 集合 |
| | |
| | | continue; |
| | | } |
| | | Set<String> urls = new HashSet<>(); |
| | | urls.addAll(entry.getKey().getPatternValues()); |
| | | if (entry.getKey().getPatternsCondition() != null) { |
| | | urls.addAll(entry.getKey().getPatternsCondition().getPatterns()); |
| | | } |
| | | if (entry.getKey().getPathPatternsCondition() != null) { |
| | | urls.addAll(convertList(entry.getKey().getPathPatternsCondition().getPatterns(), PathPattern::getPatternString)); |
| | | } |
| | | if (urls.isEmpty()) { |
| | | continue; |
| | | } |