From c21c6ab3405893d5799e3acd81168fdbd920c251 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期六, 19 十一月 2022 22:50:35 +0800
Subject: [PATCH] 不在 存userName 过去

---
 java110-core/src/main/java/com/java110/core/factory/CallApiServiceFactory.java |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/java110-core/src/main/java/com/java110/core/factory/CallApiServiceFactory.java b/java110-core/src/main/java/com/java110/core/factory/CallApiServiceFactory.java
index aa1f429..750fa4e 100755
--- a/java110-core/src/main/java/com/java110/core/factory/CallApiServiceFactory.java
+++ b/java110-core/src/main/java/com/java110/core/factory/CallApiServiceFactory.java
@@ -158,12 +158,17 @@
         }
 
         JSONObject resultVo = JSONObject.parseObject(responseEntity.getBody());
-
-        if (ResultVo.CODE_MACHINE_OK != resultVo.getInteger("code")) {
-            throw new SMOException(resultVo.getString("msg"));
+        Object bObj = null;
+        if(resultVo.containsKey("code")){
+            if (ResultVo.CODE_MACHINE_OK != resultVo.getInteger("code")) {
+                throw new SMOException(resultVo.getString("msg"));
+            }
+            bObj = resultVo.get("data");
+        }else{
+            bObj = resultVo;
         }
 
-        Object bObj = resultVo.get("data");
+
         JSONArray datas = null;
         if (bObj instanceof JSONObject) {
             datas = new JSONArray();
@@ -209,11 +214,15 @@
 
         JSONObject resultVo = JSONObject.parseObject(responseEntity.getBody());
 
-        if (!"0".equals(resultVo.getString("code"))) {
-            throw new SMOException(resultVo.getString("msg"));
+        Object bObj = null;
+        if(resultVo.containsKey("code")){
+            if (ResultVo.CODE_MACHINE_OK != resultVo.getInteger("code")) {
+                throw new SMOException(resultVo.getString("msg"));
+            }
+            bObj = resultVo.get("data");
+        }else{
+            bObj = resultVo;
         }
-
-        Object bObj = resultVo.get("data");
         JSONArray datas = null;
         if (bObj instanceof JSONObject) {
             datas = new JSONArray();

--
Gitblit v1.8.0