| | |
| | | @Override |
| | | protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException { |
| | | String access_token = JwtUtil.getAccessToken(request); |
| | | // FILTER_PATH 含 /wcs/** 时会清空 token;空板出库页需带 JWT 做 @PreAuthorize,故 /wcs/empty/** 保留 token |
| | | String servletPath = request.getServletPath(); |
| | | boolean keepWcsEmptyJwt = servletPath != null && servletPath.startsWith("/wcs/empty"); |
| | | for (String filterPath : SecurityConfig.FILTER_PATH) { |
| | | AntPathRequestMatcher antPathMatcher = new AntPathRequestMatcher(filterPath); |
| | | if (antPathMatcher.matches(request)) { |
| | | if (antPathMatcher.matches(request) && !keepWcsEmptyJwt) { |
| | | access_token = ""; |
| | | } |
| | | } |