diff --git a/pom.xml b/pom.xml index f699d574..50c4b965 100644 --- a/pom.xml +++ b/pom.xml @@ -76,6 +76,12 @@ org.springframework.boot spring-boot-starter-validation + + + org.springframework.boot + spring-boot-starter-logging + + cn.hutool hutool-all diff --git a/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java b/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java index 39b52960..4b78233d 100644 --- a/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java +++ b/src/main/java/com/ai/da/common/security/filter/AuthenticationFilter.java @@ -110,12 +110,12 @@ public class AuthenticationFilter extends OncePerRequestFilter { //校验token String cacheToken = LocalCacheUtils.getTokenCache(String.valueOf(principal.getId())); -// if(StringUtils.isEmpty(cacheToken)){ -// throw new RuntimeException("TOKEN已过期,请重新登录!"); -// } -// if(!cacheToken.equals(jwtToken) ){ -// throw new RuntimeException("TOKEN已过期,请重新登录!"); -// } + if(StringUtils.isEmpty(cacheToken)){ + throw new RuntimeException("TOKEN已过期,请重新登录!"); + } + if(!cacheToken.equals(jwtToken) ){ + throw new RuntimeException("TOKEN已过期,请重新登录!"); + } // UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(null, null); // SecurityContextHolder.getContext().setAuthentication(authentication); } diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml new file mode 100644 index 00000000..e80db240 --- /dev/null +++ b/src/main/resources/logback-spring.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + ${log.pattern.console} + + + + + + + ${log.path}/aida-info.log + + + + ${log.path}/aida-info.%d{yyyy-MM-dd}.log + + 60 + + + + ${log.pattern.file} + + + + + + + ACCEPT + + DENY + + + + + ${log.path}/aida-error.log + + + + ${log.path}/aida-error.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern.file} + + + + ERROR + + ACCEPT + + DENY + + + + + + + + + + + + + + + + + + + \ No newline at end of file