From 5b47212478619828ff4947b2124f762fd0eb61bd Mon Sep 17 00:00:00 2001 From: bigsun <407919070@qq.com> Date: Tue, 23 Apr 2024 16:09:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=E8=A7=A3=E5=86=B3=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E9=BB=98=E8=AE=A4forest=E5=8F=82=E6=95=B0=E6=97=B6,url?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=AD=89=E6=9C=AA=E8=A2=AB=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dyj/spring/DyConfigurationRegister.java | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/dy-java-spring/src/main/java/com/dyj/spring/DyConfigurationRegister.java b/dy-java-spring/src/main/java/com/dyj/spring/DyConfigurationRegister.java index 8a17457..3327679 100644 --- a/dy-java-spring/src/main/java/com/dyj/spring/DyConfigurationRegister.java +++ b/dy-java-spring/src/main/java/com/dyj/spring/DyConfigurationRegister.java @@ -68,7 +68,7 @@ public class DyConfigurationRegister implements ResourceLoaderAware, BeanPostPro } String tokenSourceClass = dyConfigurationProperties.getTokenSourceClass(); if (StringUtils.hasLength(tokenSourceClass)) { - IAgentTokenService agentTokenService = applicationContext.getBean("dyTokenService", IAgentTokenService.class); + IAgentTokenService agentTokenService = applicationContext.getBean("dyTokenService", IAgentTokenService.class); configuration.setAgentTokenService(agentTokenService); } //configuration.setInterceptorFactory(DyInterceptorFactory); @@ -77,8 +77,8 @@ public class DyConfigurationRegister implements ResourceLoaderAware, BeanPostPro public void setForestProperties() { DyForestConfigurationProperties forestProperties = dyConfigurationProperties.getForest(); + ForestConfiguration forestConfiguration = applicationContext.getBean(ForestConfiguration.class); if (Objects.nonNull(forestProperties)) { - ForestConfiguration forestConfiguration = applicationContext.getBean(ForestConfiguration.class); forestConfiguration.setBackendName(forestProperties.getBackend()); forestConfiguration.setMaxConnections(forestProperties.getMaxConnections()); forestConfiguration.setMaxRouteConnections(forestProperties.getMaxRouteConnections()); @@ -94,20 +94,24 @@ public class DyConfigurationRegister implements ResourceLoaderAware, BeanPostPro forestConfiguration.setLogResponseStatus(forestProperties.isLogResponseStatus()); forestConfiguration.setLogResponseContent(forestProperties.isLogResponseContent()); forestConfiguration.setAsyncMode(forestProperties.getAsyncMode()); - for (DyWebUrlPathEnum value : DyWebUrlPathEnum.values()) { - forestProperties.getVariables().put(value.getKey(), value.getValue()); - } - for (DyAppletUrlPathEnum value : DyAppletUrlPathEnum.values()){ - forestProperties.getVariables().put(value.getKey(), value.getValue()); - } - if(StringUtils.hasLength(dyConfigurationProperties.getDomain())){ - forestProperties.getVariables().put("domain", dyConfigurationProperties.getDomain()); - } - if (StringUtils.hasLength(dyConfigurationProperties.getTtDomain())){ - forestProperties.getVariables().put("ttDomain", dyConfigurationProperties.getTtDomain()); - } - forestConfiguration.setVariables(forestProperties.getVariables()); } + if (forestProperties == null) { + forestProperties = new DyForestConfigurationProperties(); + } + for (DyWebUrlPathEnum value : DyWebUrlPathEnum.values()) { + forestProperties.getVariables().put(value.getKey(), value.getValue()); + } + for (DyAppletUrlPathEnum value : DyAppletUrlPathEnum.values()) { + forestProperties.getVariables().put(value.getKey(), value.getValue()); + } + if (StringUtils.hasLength(dyConfigurationProperties.getDomain())) { + forestProperties.getVariables().put("domain", dyConfigurationProperties.getDomain()); + } + if (StringUtils.hasLength(dyConfigurationProperties.getTtDomain())) { + forestProperties.getVariables().put("ttDomain", dyConfigurationProperties.getTtDomain()); + } + + forestConfiguration.setVariables(forestProperties.getVariables()); } -- Gitee From 4a971d68b1f3538d8ad9e8d19590080819057f97 Mon Sep 17 00:00:00 2001 From: bigsun <407919070@qq.com> Date: Tue, 23 Apr 2024 16:11:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9ClientTokenInterceptor?= =?UTF-8?q?=E7=9A=84=E6=8C=87=E5=AE=9A=E6=B3=9B=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dyj/common/interceptor/ClientTokenInterceptor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dy-java-common/src/main/java/com/dyj/common/interceptor/ClientTokenInterceptor.java b/dy-java-common/src/main/java/com/dyj/common/interceptor/ClientTokenInterceptor.java index 0b6ec9e..ea788a2 100644 --- a/dy-java-common/src/main/java/com/dyj/common/interceptor/ClientTokenInterceptor.java +++ b/dy-java-common/src/main/java/com/dyj/common/interceptor/ClientTokenInterceptor.java @@ -9,6 +9,7 @@ import com.dyj.common.client.AuthClient; import com.dyj.common.config.AgentConfiguration; import com.dyj.common.domain.ClientTokenInfo; import com.dyj.common.domain.DyResult; +import com.dyj.common.domain.DySimpleResult; import com.dyj.common.domain.query.BaseQuery; import com.dyj.common.domain.query.ClientTokenQuery; import com.dyj.common.domain.vo.ClientTokenVo; @@ -30,7 +31,7 @@ import javax.annotation.Resource; import java.util.Objects; @Component -public class ClientTokenInterceptor implements Interceptor { +public class ClientTokenInterceptor implements Interceptor { private final Log log = LogFactory.getLog(ClientTokenInterceptor.class); @Resource private AuthClient authClient; -- Gitee