From 1893790aae7bb762f9d9fc56cb7f2241c545abf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E6=A3=AE=E6=9E=97?= Date: Fri, 25 Mar 2022 09:18:45 +0000 Subject: [PATCH] =?UTF-8?q?:art:=20=E4=BC=98=E5=8C=96=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=B6=88=E8=B4=B9=E8=80=85=E6=8A=95=E8=AF=89=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wxpay/service/impl/ComplaintServiceImpl.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java index ee7c403fd..d269a8f90 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java @@ -34,8 +34,10 @@ public class ComplaintServiceImpl implements ComplaintService { List data = complaintResult.getData(); for (ComplaintDetailResult complaintDetailResult : data) { // 对手机号进行解密操作 - String payerPhone = RsaCryptoUtil.decryptOAEP(complaintDetailResult.getPayerPhone(), this.payService.getConfig().getPrivateKey()); - complaintDetailResult.setPayerPhone(payerPhone); + if(complaintDetailResult.getPayerPhone() != null) { + String payerPhone = RsaCryptoUtil.decryptOAEP(complaintDetailResult.getPayerPhone(), this.payService.getConfig().getPrivateKey()); + complaintDetailResult.setPayerPhone(payerPhone); + } } return complaintResult; } @@ -47,8 +49,10 @@ public class ComplaintServiceImpl implements ComplaintService { String response = this.payService.getV3(url); ComplaintDetailResult result = GSON.fromJson(response, ComplaintDetailResult.class); // 对手机号进行解密操作 - String payerPhone = RsaCryptoUtil.decryptOAEP(result.getPayerPhone(), this.payService.getConfig().getPrivateKey()); - result.setPayerPhone(payerPhone); + if(result.getPayerPhone() != null) { + String payerPhone = RsaCryptoUtil.decryptOAEP(result.getPayerPhone(), this.payService.getConfig().getPrivateKey()); + result.setPayerPhone(payerPhone); + } return result; }