Browse Source

🎉 2.7.2.RELEASE

test
smallchill 4 years ago
parent
commit
72cc3adad1
  1. 4
      blade-gateway/src/main/java/org/springblade/gateway/filter/AuthFilter.java

4
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;

Loading…
Cancel
Save