diff --git a/README.md b/README.md index 2d3c2dc50ce8df2933aaca6cfd256b2fb42fe7ab..721e8d5eead267dcea9ff0ea47811f813fdcc5fe 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # zlt-microservices-platform

- Downloads - Downloads - Downloads + Downloads + Downloads + Downloads Downloads star @@ -14,6 +14,7 @@

+ ## 如果您觉得有帮助,请点右上角 "Star" 支持一下谢谢   ## 1. 总体架构图 diff --git a/pom.xml b/pom.xml index 7813afd657eee3bae5ba4ff5ce55e90d195fd96f..e09b18bbaf551fb61d550fc33c670dfa23fb8a83 100644 --- a/pom.xml +++ b/pom.xml @@ -13,9 +13,9 @@ 1.8 UTF-8 8 - 2.2.5.RELEASE - 2.3.11.RELEASE - Hoxton.SR9 + 2.2.6.RELEASE + 2.3.12.RELEASE + Hoxton.SR12 4.4 2.9.2 1.8.7 @@ -27,7 +27,7 @@ 3.1.0 2.3.8.RELEASE 1.1.0.RELEASE - 3.14.1 + 3.16.0 1.6.2 5.1.4 3.4.0 @@ -41,13 +41,13 @@ 5.0.2.RELEASE 1.27.2 1.21 - 2.12.0 + 2.12.1 1.0.2 1.9.4 1.1.6.RELEASE 2.7 4.0.1 - 4.1.3 + 4.2.3 7.11.2 2.0.5 6.2.0.Final diff --git a/zlt-gateway/sc-gateway/src/main/java/com/central/gateway/auth/Oauth2AuthSuccessHandler.java b/zlt-gateway/sc-gateway/src/main/java/com/central/gateway/auth/Oauth2AuthSuccessHandler.java index 8a02c897c37e2e57ccb7818199b5aa37a2dca085..ea1b1e8f7e8b7dfd6d3267a2f92f51eb870261f1 100644 --- a/zlt-gateway/sc-gateway/src/main/java/com/central/gateway/auth/Oauth2AuthSuccessHandler.java +++ b/zlt-gateway/sc-gateway/src/main/java/com/central/gateway/auth/Oauth2AuthSuccessHandler.java @@ -1,6 +1,7 @@ package com.central.gateway.auth; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; import com.central.common.constant.SecurityConstants; import com.central.common.model.SysUser; import com.central.oauth2.common.util.AuthUtils; @@ -26,7 +27,7 @@ import reactor.core.publisher.Mono; public class Oauth2AuthSuccessHandler implements ServerAuthenticationSuccessHandler { @Override public Mono onAuthenticationSuccess(WebFilterExchange webFilterExchange, Authentication authentication) { - MultiValueMap headerValues = new LinkedMultiValueMap(4); + MultiValueMap headerValues = new LinkedMultiValueMap<>(4); Object principal = authentication.getPrincipal(); //客户端模式只返回一个clientId if (principal instanceof SysUser) { @@ -39,8 +40,9 @@ public class Oauth2AuthSuccessHandler implements ServerAuthenticationSuccessHand headerValues.add(SecurityConstants.TENANT_HEADER, clientId); headerValues.add(SecurityConstants.ROLE_HEADER, CollectionUtil.join(authentication.getAuthorities(), ",")); String accountType = AuthUtils.getAccountType(oauth2Authentication.getUserAuthentication()); - headerValues.add(SecurityConstants.ACCOUNT_TYPE_HEADER, accountType); - + if (StrUtil.isNotEmpty(accountType)) { + headerValues.add(SecurityConstants.ACCOUNT_TYPE_HEADER, accountType); + } ServerWebExchange exchange = webFilterExchange.getExchange(); ServerHttpRequest serverHttpRequest = exchange.getRequest().mutate() .headers(h -> h.addAll(headerValues))