httpSecurity.antMatcher("/xxx/**").addFilterBefore(xxApiFilter, UsernamePasswordAuthenticationFilter.class);
@Component
public class XXApiFilter extends OncePerRequestFilter {
@Override
protected void doFilterInternal(
HttpServletRequest request, HttpServletResponse response, FilterChain chain)
throws ServletException, IOException {
String hisToken = request.getHeader("XXX_TOKEN");
//System.out.println(request.getRequestURI());
if(StringUtils.isNotEmpty(hisToken)){
chain.doFilter(request, response);
}
}
}