From 0796e9e63faad6d54515e11ac13e36a0c39c2cce Mon Sep 17 00:00:00 2001
From: CeDo <cedoogle@gmail.com>
Date: 星期四, 20 五月 2021 11:25:22 +0800
Subject: [PATCH] bugfixed

---
 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/RealNameUtil.java |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/RealNameUtil.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/RealNameUtil.java
index cac3cc6..4575728 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/RealNameUtil.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/RealNameUtil.java
@@ -40,10 +40,13 @@
         log.info("请求公安实名认证接口,请求头参数:" + headervalue + encodeToString);
         String postByJson = HttpClientUtil.sendPostByJson(URL, param, 2, headerkey, headervalue + encodeToString);
         log.info("请求公安实名认证接口,返回参数:" + postByJson);
-        if(postByJson!=null) {
-            int code = JSONObject.parseObject(postByJson).getIntValue("code");
-            if (0 == code) {
-                result = true;
+        if(postByJson!=null && StringUtils.isNotEmpty(postByJson)) {
+            JSONObject obj = JSONObject.parseObject(postByJson);
+            if(obj!=null) {
+                int code = JSONObject.parseObject(postByJson).getIntValue("code");
+                if (0 == code) {
+                    result = true;
+                }
             }
         }else{
             throw new ServiceException("公安实名认证接口超时,请重试");

--
Gitblit v1.7.1