Browse Source

⬆️ 更新alibabacloud至2.2.4.RELEASE,适配类引用

test
smallchill 4 years ago
parent
commit
0ed6f896a8
  1. 2
      blade-auth/src/main/java/org/springblade/auth/service/BladeUserDetailsServiceImpl.java
  2. 4
      blade-gateway/src/main/java/org/springblade/gateway/filter/AuthFilter.java
  3. 6
      blade-gateway/src/main/java/org/springblade/gateway/filter/GlobalRequestLogFilter.java
  4. 4
      blade-gateway/src/main/java/org/springblade/gateway/filter/GlobalResponseLogFilter.java

2
blade-auth/src/main/java/org/springblade/auth/service/BladeUserDetailsServiceImpl.java

@ -18,7 +18,7 @@ package org.springblade.auth.service;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang.StringUtils;
import org.springblade.auth.constant.AuthConstant;
import org.springblade.auth.utils.TokenUtil;
import org.springblade.core.tool.api.R;

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;

6
blade-gateway/src/main/java/org/springblade/gateway/filter/GlobalRequestLogFilter.java

@ -19,7 +19,7 @@ package org.springblade.gateway.filter;
import io.jsonwebtoken.Claims;
import lombok.RequiredArgsConstructor;
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.gateway.provider.AuthProvider;
import org.springblade.gateway.provider.RequestProvider;
@ -93,9 +93,9 @@ public class GlobalRequestLogFilter implements GlobalFilter, Ordered {
beforeReqArgs.add((claims == null) ? "" : claims.toString());
beforeReqLog.append("===Headers=== {}: {}\n");
beforeReqArgs.add(headerName.concat("-original"));
beforeReqArgs.add(StringUtils.join(headerValue));
beforeReqArgs.add(StringUtils.join(headerValue.toArray()));
} else {
beforeReqArgs.add(StringUtils.join(headerValue));
beforeReqArgs.add(StringUtils.join(headerValue.toArray()));
}
});

4
blade-gateway/src/main/java/org/springblade/gateway/filter/GlobalResponseLogFilter.java

@ -18,7 +18,7 @@ package org.springblade.gateway.filter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
@ -82,7 +82,7 @@ public class GlobalResponseLogFilter implements GlobalFilter, Ordered {
headers.forEach((headerName, headerValue) -> {
responseLog.append("===Headers=== {}: {}\n");
responseArgs.add(headerName);
responseArgs.add(StringUtils.join(headerValue));
responseArgs.add(StringUtils.join(headerValue.toArray()));
});
responseLog.append("================ Gateway Response End =================\n");

Loading…
Cancel
Save