项目场景:
Springboot + Spring Security + JTW +Vue,中判断前端的页面是否有token或者token是否过期的问题时遇到的bug
问题描述
在经JwtAuthenticationFilter extends BasicAuthenticationFilter拦截时,出现jwt有值的情况下,Claims claim = jwtUtils.getClaimByToken(jwt);claim 为null。
package com.bingtuan.security;
import cn.hutool.core.util.StrUtil;
import com.bingtuan.entity.SysUser;
import com.bingtuan.service.SysUserService;
import com.bingtuan.utils.JwtUtils;
import com.bingtuan.utils.RedisUtil;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.JwtException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core