🐛 解决未配置微信支付公钥的情况下启动失败的问题

This commit is contained in:
xucun
2025-06-11 18:56:04 +08:00
parent 20f80c16db
commit a4fa017cec

View File

@@ -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 =