From 72cc3adad10bfe3a7dee38a4ed1bf84c7a7612a7 Mon Sep 17 00:00:00 2001 From: smallchill Date: Mon, 1 Feb 2021 18:10:44 +0800 Subject: [PATCH] :tada: 2.7.2.RELEASE --- .../main/java/org/springblade/gateway/filter/AuthFilter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blade-gateway/src/main/java/org/springblade/gateway/filter/AuthFilter.java b/blade-gateway/src/main/java/org/springblade/gateway/filter/AuthFilter.java index 0ee019816..aa0c86742 100644 --- a/blade-gateway/src/main/java/org/springblade/gateway/filter/AuthFilter.java +++ b/blade-gateway/src/main/java/org/springblade/gateway/filter/AuthFilter.java @@ -21,7 +21,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.jsonwebtoken.Claims; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang.StringUtils; import org.springblade.core.jwt.JwtUtil; import org.springblade.core.jwt.props.JwtProperties; import org.springblade.core.launch.constant.TokenConstant; @@ -67,7 +67,7 @@ public class AuthFilter implements GlobalFilter, Ordered { ServerHttpResponse resp = exchange.getResponse(); String headerToken = exchange.getRequest().getHeaders().getFirst(AuthProvider.AUTH_KEY); String paramToken = exchange.getRequest().getQueryParams().getFirst(AuthProvider.AUTH_KEY); - if (StringUtils.isAllBlank(headerToken, paramToken)) { + if (StringUtils.isBlank(headerToken) && StringUtils.isBlank(paramToken)) { return unAuth(resp, "缺失令牌,鉴权失败"); } String auth = StringUtils.isBlank(headerToken) ? paramToken : headerToken;