From b8f328b90b492e7065235ce91f1ca875698ebf69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Forever=E6=9D=A8?= <453190450@qq.com> Date: Wed, 8 Dec 2021 18:26:49 +0800 Subject: [PATCH] =?UTF-8?q?:art:=E3=80=90=E5=BE=AE=E4=BF=A1=E5=BC=80?= =?UTF-8?q?=E6=94=BE=E5=B9=B3=E5=8F=B0=E3=80=91=E4=BC=98=E5=8C=96=20Spring?= =?UTF-8?q?=20Boot=20Starter=20=E9=85=8D=E7=BD=AE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tractWxOpenConfigStorageConfiguration.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/spring-boot-starters/wx-java-open-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/config/storage/AbstractWxOpenConfigStorageConfiguration.java b/spring-boot-starters/wx-java-open-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/config/storage/AbstractWxOpenConfigStorageConfiguration.java index 0f77633e4..ee0443c9a 100644 --- a/spring-boot-starters/wx-java-open-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/config/storage/AbstractWxOpenConfigStorageConfiguration.java +++ b/spring-boot-starters/wx-java-open-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/open/config/storage/AbstractWxOpenConfigStorageConfiguration.java @@ -9,19 +9,20 @@ import me.chanjar.weixin.open.api.impl.WxOpenInMemoryConfigStorage; public abstract class AbstractWxOpenConfigStorageConfiguration { protected WxOpenInMemoryConfigStorage config(WxOpenInMemoryConfigStorage config, WxOpenProperties properties) { - WxOpenProperties.ConfigStorage configStorageProperties = properties.getConfigStorage(); + WxOpenProperties.ConfigStorage storage = properties.getConfigStorage(); config.setWxOpenInfo(properties.getAppId(), properties.getSecret(), properties.getToken(), properties.getAesKey()); - config.setHttpProxyHost(configStorageProperties.getHttpProxyHost()); - config.setHttpProxyUsername(configStorageProperties.getHttpProxyUsername()); - config.setHttpProxyPassword(configStorageProperties.getHttpProxyPassword()); - if (configStorageProperties.getHttpProxyPort() != null) { - config.setHttpProxyPort(configStorageProperties.getHttpProxyPort()); + config.setHttpProxyHost(storage.getHttpProxyHost()); + config.setHttpProxyUsername(storage.getHttpProxyUsername()); + config.setHttpProxyPassword(storage.getHttpProxyPassword()); + Integer httpProxyPort = storage.getHttpProxyPort(); + if (httpProxyPort != null) { + config.setHttpProxyPort(httpProxyPort); } - int maxRetryTimes = configStorageProperties.getMaxRetryTimes(); - if (configStorageProperties.getMaxRetryTimes() < 0) { + int maxRetryTimes = storage.getMaxRetryTimes(); + if (maxRetryTimes < 0) { maxRetryTimes = 0; } - int retrySleepMillis = configStorageProperties.getRetrySleepMillis(); + int retrySleepMillis = storage.getRetrySleepMillis(); if (retrySleepMillis < 0) { retrySleepMillis = 1000; }