From 1e003ee571848bbc5c27d18eb96440921546a7c6 Mon Sep 17 00:00:00 2001 From: GadflyFang Date: Tue, 21 Jan 2025 18:44:33 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E4=BF=AE=E5=A4=8D=2094aaff4=20?= =?UTF-8?q?=E5=BC=95=E5=85=A5=E7=9A=84=E9=94=99=E8=AF=AF=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E8=AF=81=E4=B9=A6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/github/binarywang/wxpay/config/WxPayConfig.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java index 293c52eac..8cbf954ee 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java @@ -14,6 +14,7 @@ import java.security.PrivateKey; import java.security.PublicKey; import java.security.cert.Certificate; import java.security.cert.X509Certificate; +import java.util.Base64; import java.util.Optional; import javax.net.ssl.SSLContext; import lombok.Data; @@ -371,7 +372,7 @@ public class WxPayConfig { if (configContent != null) { inputStream = new ByteArrayInputStream(configContent); } else if (StringUtils.isNotEmpty(configString)) { - configContent = configString.getBytes(StandardCharsets.UTF_8); + configContent = Base64.getDecoder().decode(configString); inputStream = new ByteArrayInputStream(configContent); } else { if (StringUtils.isBlank(configPath)) {