diff --git a/IJPay-Demo-SpringBoot/src/main/java/com/ijpay/demo/controller/wxpay/WxPayV3Controller.java b/IJPay-Demo-SpringBoot/src/main/java/com/ijpay/demo/controller/wxpay/WxPayV3Controller.java index 1d55219ba079ccdee5da101d5408de1df3f4a5ee..255c74bde828c60a69f0c6e4524dc196cb3f3c70 100644 --- a/IJPay-Demo-SpringBoot/src/main/java/com/ijpay/demo/controller/wxpay/WxPayV3Controller.java +++ b/IJPay-Demo-SpringBoot/src/main/java/com/ijpay/demo/controller/wxpay/WxPayV3Controller.java @@ -166,6 +166,7 @@ public class WxPayV3Controller { // 保存证书 FileWriter writer = new FileWriter(certPath); writer.write(publicKey); + writer.close(); // 关闭 writer // 获取平台证书序列号 X509Certificate certificate = PayKit.getCertificate(new ByteArrayInputStream(publicKey.getBytes())); return certificate.getSerialNumber().toString(16).toUpperCase();