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