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 0b6ec9e2ac4939111f14e0809896d6bb6fe9779c..ea788a2647718ef5db9d0983a1d679d875c6501f 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; 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 8a17457fda31637f1d77b41d164cf68cc3b303d5..332767979208bb2461884f1fe743ebe4f973c059 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()); }