This commit is contained in:
胡金宇 2017-08-25 12:15:42 +08:00
parent 01fa30f0da
commit 75dfc912f4

View File

@ -91,14 +91,14 @@ public class MchApi extends BaseApi {
* *
* @return * @return
*/ */
protected WeixinRequestExecutor getWeixinSSLExecutor() throws WeixinException { protected WeixinRequestExecutor getWeixinSSLExecutor() throws WeixinException {
if (weixinSSLExecutor == null) { if (weixinSSLExecutor == null) {
try { try {
InputStream is = null; InputStream is = null;
File certificate = new File( File certificate = new File(
Weixin4jConfigUtil.replaceClassPathValue(weixinAccount.getCertificateFile())); Weixin4jConfigUtil.replaceClassPathValue(weixinAccount.getCertificateFile()));
if (!certificate.exists() || !certificate.isFile()) { if (!certificate.exists() || !certificate.isFile()) {
is = Weixin4jConfigUtil.CLASSLOADER.getResourceAsStream(weixinAccount.getCertificateFile()); is = Weixin4jConfigUtil.CLASSLOADER.getResourceAsStream(certificate.getName());
} else { } else {
is = new FileInputStream(certificate); is = new FileInputStream(certificate);
} }