Commit 27fef32bb931d10d6e6e3705e6095a7800525779

Authored by 谭毅彬
1 parent 810864e9

代码细节修正(2)

Signed-off-by: TanYibin <5491541@qq.com>
huaheng-wms-core/src/main/java/org/jeecg/utils/aspect/TaskBuildAudienceAspect.java
1 1 package org.jeecg.utils.aspect;
2 2  
3   -import java.lang.reflect.Method;
4   -
5   -import javax.servlet.http.HttpServletRequest;
6   -
7 3 import org.aspectj.lang.JoinPoint;
8 4 import org.aspectj.lang.annotation.Aspect;
9 5 import org.aspectj.lang.annotation.Before;
10 6 import org.aspectj.lang.annotation.Pointcut;
11   -import org.aspectj.lang.reflect.MethodSignature;
12 7 import org.jeecg.utils.HuahengJwtUtil;
13   -import org.jeecg.utils.config.ApplicationConfig;
14 8 import org.jeecg.utils.support.ApiAuthentication;
15   -import org.jeecg.utils.support.PassApiAuthentication;
16   -import org.jeecg.utils.support.RSA256Key;
17   -import org.springframework.beans.factory.annotation.Autowired;
18 9 import org.springframework.scheduling.annotation.EnableAsync;
19 10 import org.springframework.stereotype.Component;
20   -import org.springframework.web.context.request.RequestContextHolder;
21   -import org.springframework.web.context.request.ServletRequestAttributes;
22   -
23   -import com.auth0.jwt.JWT;
24   -import com.auth0.jwt.JWTVerifier;
25   -import com.auth0.jwt.algorithms.Algorithm;
26   -import com.auth0.jwt.exceptions.JWTVerificationException;
27   -import com.auth0.jwt.interfaces.DecodedJWT;
28 11  
29 12 import lombok.extern.slf4j.Slf4j;
30 13  
... ... @@ -42,14 +25,6 @@ public class TaskBuildAudienceAspect {
42 25 @Pointcut("execution(* org.jeecg.modules.wms.monitor.job.*Task.execute(..))")
43 26 public void executeTask() {}
44 27  
45   - /**
46   - * API Token 验证
47   - * @author TanYibin
48   - * @createDate 2023年2月14日
49   - * @param joinPoint
50   - * @throws NoSuchMethodException
51   - * @throws Throwable
52   - */
53 28 @Before("executeTask()")
54 29 public void doBefore(JoinPoint joinPoint) throws NoSuchMethodException, Throwable {
55 30 new ApiAuthentication.ApiAuthenticationBuild().audience(HuahengJwtUtil.TASK_AUDIENCE_NAME).bulid();
... ...
huaheng-wms-core/src/main/java/org/jeecg/utils/support/ExceptionHandlerAdvice.java
1 1 package org.jeecg.utils.support;
2 2  
3 3 import java.util.HashMap;
4   -import java.util.Map;
5 4  
6 5 import org.jeecg.common.api.vo.Result;
7 6 import org.springframework.validation.FieldError;
... ... @@ -19,7 +18,6 @@ public class ExceptionHandlerAdvice {
19 18 */
20 19 @ExceptionHandler(value = MethodArgumentNotValidException.class)
21 20 public Object handerConstraintViolationException(MethodArgumentNotValidException exception) {
22   - Result<Map> result = new Result<Map>();
23 21 HashMap<String, Object> errors = new HashMap<>();
24 22 exception.getBindingResult().getAllErrors().forEach(error -> {
25 23 FieldError fieldError = (FieldError)error;
... ...