修复代理没有设置时会存在的问题

This commit is contained in:
Binary Wang
2016-09-16 21:52:40 +08:00
parent b26a01767d
commit 21f14971c1
4 changed files with 51 additions and 43 deletions

View File

@@ -515,8 +515,10 @@ public class WxMpServiceImpl implements WxMpService {
apacheHttpClientBuilder.sslConnectionSocketFactory(sslsf);
}
this.httpProxy = new HttpHost(this.configStorage.getHttpProxyHost(),
this.configStorage.getHttpProxyPort());
if (this.configStorage.getHttpProxyHost() != null && this.configStorage.getHttpProxyPort() > 0) {
this.httpProxy = new HttpHost(this.configStorage.getHttpProxyHost(), this.configStorage.getHttpProxyPort());
}
this.httpClient = apacheHttpClientBuilder.build();
}