| | |
| | | * @author ruoyi |
| | | */ |
| | | @Component |
| | | public class JwtAuthenticationTokenFilter extends OncePerRequestFilter |
| | | { |
| | | public class JwtAuthenticationTokenFilter extends OncePerRequestFilter { |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | @Override |
| | | protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) |
| | | throws ServletException, IOException |
| | | { |
| | | throws ServletException, IOException { |
| | | LoginUser loginUser = tokenService.getLoginUser(request); |
| | | if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication())) { |
| | | tokenService.verifyToken(loginUser); |