|
|
@@ -13,6 +13,7 @@ import org.springframework.cloud.gateway.filter.GatewayFilterChain;
|
|
|
import org.springframework.cloud.gateway.filter.GlobalFilter;
|
|
|
import org.springframework.http.server.reactive.ServerHttpRequest;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.server.ServerWebExchange;
|
|
|
import reactor.core.publisher.Mono;
|
|
|
@@ -93,7 +94,7 @@ public class WebFluxUserRequestInfoFilter implements GlobalFilter {
|
|
|
}
|
|
|
//租户转换类型
|
|
|
List<String> tenantMap = (List<String>) jwsObject.getPayload().toJSONObject().get("tenant");
|
|
|
- String tenant = tenantMap.isEmpty()? "unknown" : tenantMap.get(0);
|
|
|
+ String tenant = CollectionUtils.isEmpty(tenantMap) ? "unknown" : tenantMap.get(0);
|
|
|
ServerHttpRequest request = exchange.getRequest()
|
|
|
.mutate()
|
|
|
.header("userId", String.valueOf(jwsObject.getPayload().toJSONObject().get("sub")))
|