排除options预检请求

This commit is contained in:
莫云赵 2020-03-24 14:21:02 +08:00 committed by Gitee
parent e07d4c18ee
commit 3af95ad436

View File

@ -31,6 +31,9 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
throws ServletException, IOException
{
if (HttpMethod.OPTIONS.toString().equals(request.getMethod())) {
chain.doFilter(request, response);
}
LoginUser loginUser = tokenService.getLoginUser(request);
if (StringUtils.isNotNull(loginUser) && StringUtils.isNull(SecurityUtils.getAuthentication()))
{