From c4f0b2348f2e73df551cd0f4b5a893674bb933fe Mon Sep 17 00:00:00 2001 From: heshunme Date: Wed, 3 Jul 2024 14:12:42 +0800 Subject: [PATCH] bugfix@JwtVerify --- src/main/java/org/cmh/backend/Utils/JwtVerifyAspect.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/cmh/backend/Utils/JwtVerifyAspect.java b/src/main/java/org/cmh/backend/Utils/JwtVerifyAspect.java index 26cee34..5104981 100644 --- a/src/main/java/org/cmh/backend/Utils/JwtVerifyAspect.java +++ b/src/main/java/org/cmh/backend/Utils/JwtVerifyAspect.java @@ -8,7 +8,7 @@ import org.springframework.stereotype.Component; @Aspect @Component public class JwtVerifyAspect { - @Before("@annotation(JwtVerify)") + @Before("@annotation(JwtVerify)&&args(..)") public void verifyJwtToken(JoinPoint joinPoint) throws JwtValidationException { Object[] args = joinPoint.getArgs(); for (Object arg : args) { @@ -17,8 +17,8 @@ public class JwtVerifyAspect { if (!JwtUtil.isTokenValid(token)) { throw new JwtValidationException("JWT token is invalid"); } + break; } - break; } } }