mirror of
https://github.com/YunaiV/ruoyi-vue-pro.git
synced 2025-11-01 13:05:53 +08:00
feat:【framework 框架】ApiEncryptFilter 的 getApiEncrypt 优化成 jdk8 写法,更好适配
This commit is contained in:
@ -128,6 +128,7 @@ public class ApiEncryptFilter extends ApiRequestFilter {
|
||||
*
|
||||
* @param request 请求
|
||||
*/
|
||||
@SuppressWarnings("PatternVariableCanBeUsed")
|
||||
private ApiEncrypt getApiEncrypt(HttpServletRequest request) {
|
||||
try {
|
||||
HandlerExecutionChain mappingHandler = requestMappingHandlerMapping.getHandler(request);
|
||||
@ -135,7 +136,8 @@ public class ApiEncryptFilter extends ApiRequestFilter {
|
||||
return null;
|
||||
}
|
||||
Object handler = mappingHandler.getHandler();
|
||||
if (handler instanceof HandlerMethod handlerMethod) {
|
||||
if (handler instanceof HandlerMethod) {
|
||||
HandlerMethod handlerMethod = (HandlerMethod) handler;
|
||||
ApiEncrypt annotation = handlerMethod.getMethodAnnotation(ApiEncrypt.class);
|
||||
if (annotation == null) {
|
||||
annotation = handlerMethod.getBeanType().getAnnotation(ApiEncrypt.class);
|
||||
|
||||
Reference in New Issue
Block a user