|
|
@@ -47,14 +47,14 @@ public class ThirdPartyJwtAuthFilter extends OncePerRequestFilter {
|
|
|
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
|
|
|
|
|
|
String requestUri = request.getRequestURI();
|
|
|
- log.info("第三方JWT过滤器处理请求: {}", requestUri);
|
|
|
+ log.warn("第三方JWT过滤器处理请求: {}", requestUri);
|
|
|
|
|
|
boolean isThirdPartyRequest = thirdPartyApiPaths.stream()
|
|
|
.anyMatch(pattern -> pathMatcher.match(pattern, requestUri));
|
|
|
|
|
|
// 检查当前请求是否是需要第三方Token验证的接口
|
|
|
if (isThirdPartyRequest) {
|
|
|
- log.info("检测到第三方接口请求: {}", requestUri);
|
|
|
+ log.warn("检测到第三方接口请求: {}", requestUri);
|
|
|
String token = extractToken(request);
|
|
|
|
|
|
if (token == null) {
|
|
|
@@ -65,14 +65,14 @@ public class ThirdPartyJwtAuthFilter extends OncePerRequestFilter {
|
|
|
return; // 重要:直接返回,不再执行过滤链后续操作
|
|
|
}
|
|
|
|
|
|
- log.info("提取到Token: {}...", token.substring(0, Math.min(20, token.length())));
|
|
|
+ log.warn("提取到Token: {}...", token.substring(0, Math.min(20, token.length())));
|
|
|
|
|
|
try {
|
|
|
// 验证Token的有效性(例如是否过期、签名是否正确)
|
|
|
if (jwtTokenUtil.validateToken(token)) {
|
|
|
// 从Token中解析用户标识
|
|
|
String principal = jwtTokenUtil.getOperatorIdFromToken(token);
|
|
|
- log.info("Token验证成功,OperatorID: {}", principal);
|
|
|
+ log.warn("Token验证成功,OperatorID: {}", principal);
|
|
|
// 构建Authentication对象,细节见下文
|
|
|
UsernamePasswordAuthenticationToken authentication =
|
|
|
new UsernamePasswordAuthenticationToken(principal, null, new ArrayList<>());
|