From 0ce1f94a0f262a8831f8eb9fd5cf67422dd1d69b Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期五, 27 九月 2024 12:07:38 +0800 Subject: [PATCH] 合併代碼 --- ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/wx/model/V3.java | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/wx/model/V3.java b/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/wx/model/V3.java index b08ca9d..68aa7ec 100644 --- a/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/wx/model/V3.java +++ b/ruoyi-service/ruoyi-payment/src/main/java/com/ruoyi/payment/wx/model/V3.java @@ -61,12 +61,15 @@ certStream = new FileInputStream(this.privateKeyPath); certData = IOUtils.toByteArray(certStream); } catch (IOException e) { + e.printStackTrace(); throw new RuntimeException("私钥文件未找到"); }finally { - try { - certStream.close(); - } catch (IOException e) { - log.error("私钥流关闭异常"); + if(null != certStream){ + try { + certStream.close(); + } catch (IOException e) { + log.error("私钥流关闭异常"); + } } } return new ByteArrayInputStream(certData); -- Gitblit v1.7.1