This commit is contained in:
admin
2024-07-26 00:34:57 +08:00
parent 4c5b046107
commit e33a01042d
5 changed files with 70 additions and 64 deletions

View File

@@ -82,13 +82,11 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
protected void doFilterInternal(@NotNull HttpServletRequest httpServletRequest, @NotNull HttpServletResponse httpServletResponse, @NotNull FilterChain filterChain) throws ServletException, IOException {
log.info("url = {}", httpServletRequest.getRequestURI());
// //微信支付回调接口,不需要验证
//微信支付回调接口,不需要验证
if ("/wx/pay/jsCallback".equals(httpServletRequest.getServletPath())) {
log.info("微信支付回调,不需要验证");
filterChain.doFilter(httpServletRequest, httpServletResponse);
return;
}
// 微信公众号的请求必须存在tenantkey否则抛出异常
} else {// 微信公众号的请求必须存在tenantkey否则抛出异常
if (httpServletRequest.getServletPath().startsWith("/wx/")) {
String tenantKey = httpServletRequest.getHeader("tenantkey");
@@ -96,7 +94,7 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
resolver.resolveException(httpServletRequest, httpServletResponse, null, new CustomException("tenantkey不能为空"));
return;
}
if (noLoginPathRequired.contains(httpServletRequest.getServletPath())) {
if (noLoginPathRequired.contains(httpServletRequest.getServletPath())) {
//非必须登录的请求,验证租户信息是否正常
String tenantId;
try {
@@ -152,6 +150,7 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
}
}
filterChain.doFilter(httpServletRequest, httpServletResponse);
}
}