From 957b8e9d4bc63524dad27c2f8458856da0bf5c06 Mon Sep 17 00:00:00 2001
From: 张海江 <181069201@qq.com>
Date: Mon, 07 Aug 2017 13:20:28 +0800
Subject: [PATCH] 提交代码

---
 app/src/main/java/com/moral/yunfushao/httputils/HttpUtils.java |   32 ++++++++++++++++++--------------
 1 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/app/src/main/java/com/moral/yunfushao/httputils/HttpUtils.java b/app/src/main/java/com/moral/yunfushao/httputils/HttpUtils.java
index 75df65f..7614692 100644
--- a/app/src/main/java/com/moral/yunfushao/httputils/HttpUtils.java
+++ b/app/src/main/java/com/moral/yunfushao/httputils/HttpUtils.java
@@ -53,11 +53,12 @@
                     public void onSuccess(String s, Call call, Response response) {
                         XLog.e("result:" + s);
                         try {
-                            JSONObject jsonObject = new JSONObject(s);
+                            JSONObject resJosn= new JSONObject(s);
+                            JSONObject jsonObject = resJosn.getJSONObject("data");
                             int errno = jsonObject.optInt("code");
-                            String message = jsonObject.optString("desc");
+                            String message = jsonObject.optString("msg");
                             if(errno == 0){
-                                httpCallBack.onSuccess(jsonObject.optString("content"),message);
+                                httpCallBack.onSuccess(jsonObject.optString("info"),message);
                             }else{
                                 httpCallBack.onFail(errno,message);
                             }
@@ -135,11 +136,12 @@
                     public void onSuccess(String s, Call call, Response response) {
                         XLog.e("result:" + s);
                         try {
-                            JSONObject jsonObject = new JSONObject(s);
+                            JSONObject resJosn= new JSONObject(s);
+                            JSONObject jsonObject = resJosn.getJSONObject("data");
                             int errno = jsonObject.optInt("code");
-                            String message = jsonObject.optString("desc");
+                            String message = jsonObject.optString("msg");
                             if(errno == 0){
-                                httpCallBack.onSuccess(jsonObject.optString("content"),message);
+                                httpCallBack.onSuccess(jsonObject.optString("info"),message);
                             }else{
                                 httpCallBack.onFail(errno,message);
                             }
@@ -209,11 +211,12 @@
                     public void onSuccess(String s, Call call, Response response) {
                         XLog.e("result:" + s);
                         try {
-                            JSONObject jsonObject = new JSONObject(s);
-                            int errno = jsonObject.optInt("errno");
-                            String message = jsonObject.optString("message");
+                            JSONObject resJosn= new JSONObject(s);
+                            JSONObject jsonObject = resJosn.getJSONObject("data");
+                            int errno = jsonObject.optInt("code");
+                            String message = jsonObject.optString("msg");
                             if(errno == 0){
-                                uploadCallBack.onSuccess(jsonObject.optString("data"),message);
+                                uploadCallBack.onSuccess(jsonObject.optString("info"),message);
                             }else{
                                 uploadCallBack.onFail(message);
                             }
@@ -290,11 +293,12 @@
                     public void onSuccess(String s, Call call, Response response) {
                         XLog.e("result:" + s);
                         try {
-                            JSONObject jsonObject = new JSONObject(s);
-                            int errno = jsonObject.optInt("errno");
-                            String message = jsonObject.optString("message");
+                            JSONObject resJosn= new JSONObject(s);
+                            JSONObject jsonObject = resJosn.getJSONObject("data");
+                            int errno = jsonObject.optInt("code");
+                            String message = jsonObject.optString("msg");
                             if(errno == 0){
-                                uploadCallBack.onSuccess(jsonObject.optString("data"),message);
+                                uploadCallBack.onSuccess(jsonObject.optString("info"),message);
                             }else{
                                 uploadCallBack.onFail(message);
                             }

--
Gitblit v1.8.0