From 7307444d2d7c8d48fbf44c1770aa63187e795e28 Mon Sep 17 00:00:00 2001 From: 562935844@qq.com Date: 星期四, 17 八月 2023 11:39:18 +0800 Subject: [PATCH] 切换为打包模式 --- AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java | 17 ++++++++++++----- 1 files changed, 12 insertions(+), 5 deletions(-) diff --git a/AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java b/AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java index 4508b6c..1af77fd 100644 --- a/AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java +++ b/AndroidOpenDemo/DeviceAddModule/src/main/java/com/mm/android/deviceaddmodule/openapi/HttpSend.java @@ -1,5 +1,6 @@ package com.mm.android.deviceaddmodule.openapi; +import android.content.Intent; import android.text.TextUtils; import com.google.gson.Gson; @@ -7,12 +8,14 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.reflect.TypeToken; +import hdl.onpro.HdlData; import com.mm.android.deviceaddmodule.LCDeviceEngine; import com.mm.android.deviceaddmodule.mobilecommon.AppConsume.BusinessException; import com.mm.android.deviceaddmodule.mobilecommon.utils.LogUtil; import com.mm.android.deviceaddmodule.mobilecommon.utils.MD5Helper; import org.apache.http.conn.ConnectTimeoutException; +import org.greenrobot.eventbus.EventBus; import org.json.JSONObject; import java.io.IOException; @@ -53,13 +56,17 @@ } String code = jsonResult.get("code").getAsString(); if (!"0".equals(code)) { -// try { + try { String msg = jsonResult.get("msg").getAsString(); + EventBus.getDefault().post("InterfaceException"); + hdl.onpro.HdlData.getInstance().getiRegisterDeviceFeedback().feedback(method,jsonResult.toString()); throw new BusinessException(code + msg); -// }catch (Exception exception){ -// String msg = jsonResult.get("message").getAsString(); -// throw new BusinessException(code + msg); -// } + }catch (Exception exception){ + String msg = jsonResult.get("message").getAsString(); + EventBus.getDefault().post("InterfaceException"); + hdl.onpro.HdlData.getInstance().getiRegisterDeviceFeedback().feedback(method,jsonResult.toString()); + throw new BusinessException(code + msg); + } } JsonObject jsonData = new JsonObject(); -- Gitblit v1.8.0