Commit dac0c278bf69402c1a1ef3d1633cd8b2fde7c4ad
1 parent
2e47ffdb
feat:【framework 框架】ApiEncryptFilter 的 getApiEncrypt 优化成 jdk8 写法,更好适配
Showing
1 changed file
with
3 additions
and
1 deletions
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/encrypt/core/filter/ApiEncryptFilter.java
| @@ -128,6 +128,7 @@ public class ApiEncryptFilter extends ApiRequestFilter { | @@ -128,6 +128,7 @@ public class ApiEncryptFilter extends ApiRequestFilter { | ||
| 128 | * | 128 | * |
| 129 | * @param request 请求 | 129 | * @param request 请求 |
| 130 | */ | 130 | */ |
| 131 | + @SuppressWarnings("PatternVariableCanBeUsed") | ||
| 131 | private ApiEncrypt getApiEncrypt(HttpServletRequest request) { | 132 | private ApiEncrypt getApiEncrypt(HttpServletRequest request) { |
| 132 | try { | 133 | try { |
| 133 | HandlerExecutionChain mappingHandler = requestMappingHandlerMapping.getHandler(request); | 134 | HandlerExecutionChain mappingHandler = requestMappingHandlerMapping.getHandler(request); |
| @@ -135,7 +136,8 @@ public class ApiEncryptFilter extends ApiRequestFilter { | @@ -135,7 +136,8 @@ public class ApiEncryptFilter extends ApiRequestFilter { | ||
| 135 | return null; | 136 | return null; |
| 136 | } | 137 | } |
| 137 | Object handler = mappingHandler.getHandler(); | 138 | Object handler = mappingHandler.getHandler(); |
| 138 | - if (handler instanceof HandlerMethod handlerMethod) { | 139 | + if (handler instanceof HandlerMethod) { |
| 140 | + HandlerMethod handlerMethod = (HandlerMethod) handler; | ||
| 139 | ApiEncrypt annotation = handlerMethod.getMethodAnnotation(ApiEncrypt.class); | 141 | ApiEncrypt annotation = handlerMethod.getMethodAnnotation(ApiEncrypt.class); |
| 140 | if (annotation == null) { | 142 | if (annotation == null) { |
| 141 | annotation = handlerMethod.getBeanType().getAnnotation(ApiEncrypt.class); | 143 | annotation = handlerMethod.getBeanType().getAnnotation(ApiEncrypt.class); |