From a4fa017cece1981828a026fc7b22ac8865a44fa3 Mon Sep 17 00:00:00 2001 From: xucun Date: Wed, 11 Jun 2025 18:56:04 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E8=A7=A3=E5=86=B3=E6=9C=AA=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98=E5=85=AC=E9=92=A5?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=E5=90=AF=E5=8A=A8=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../felord/payment/wechat/InMemoryWechatTenantService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/InMemoryWechatTenantService.java b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/InMemoryWechatTenantService.java index 2b361b5..b8e1c1c 100644 --- a/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/InMemoryWechatTenantService.java +++ b/payment-spring-boot-autoconfigure/src/main/java/cn/felord/payment/wechat/InMemoryWechatTenantService.java @@ -27,6 +27,7 @@ import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; import org.springframework.util.CollectionUtils; import org.springframework.util.ResourceUtils; +import org.springframework.util.StringUtils; import java.io.FileReader; import java.io.InputStreamReader; @@ -79,6 +80,10 @@ public class InMemoryWechatTenantService implements WechatTenantService { } private WeChatPublicKeyInfo initWeChatPublicKeyInfo(WechatMetaBean meta) { + boolean enablePublicKey=StringUtils.hasLength(meta.getV3().getWeChatPayPublicKeyId()) && StringUtils.hasLength(meta.getV3().getWeChatPayPublicKeyPath()); + if (!enablePublicKey) { + return null; + } try { String certPath=meta.getV3().getWeChatPayPublicKeyPath(); Resource resource =