Pu Zhibing
2024-11-06 73be7ff2317fea8194b7a6dc0452b64a511c7836
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);