From 7c669b338fcbc3277e48fbbc32d35b105f3805bb Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Tue, 26 Mar 2024 16:31:15 +0800 Subject: [PATCH] =?UTF-8?q?fix=20[=E8=8E=B7=E5=8F=96=E6=8C=87=E5=AF=BC?= =?UTF-8?q?=E5=91=98=E5=A4=87=E6=B3=A8=E4=BF=A1=E6=81=AF=20=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E6=97=B6=E7=9A=84=E9=97=AA=E9=80=80=E9=97=AE=E9=A2=98?= =?UTF-8?q?]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manager/InstructorRemarkManager.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/manager/InstructorRemarkManager.java b/common/src/main/java/com/yunbao/common/manager/InstructorRemarkManager.java index 4f725ed..2b81e5e 100644 --- a/common/src/main/java/com/yunbao/common/manager/InstructorRemarkManager.java +++ b/common/src/main/java/com/yunbao/common/manager/InstructorRemarkManager.java @@ -4,12 +4,16 @@ import android.content.Context; import android.os.Handler; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.TypeReference; import com.google.gson.Gson; +import com.lzy.okgo.model.Response; import com.yunbao.common.bean.IMLoginModel; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpClient; +import com.yunbao.common.http.JsonBean; import com.yunbao.common.manager.base.BaseCacheManager; +import com.yunbao.common.utils.StringUtil; import java.util.HashMap; import java.util.Map; @@ -36,8 +40,12 @@ public class InstructorRemarkManager extends BaseCacheManager { */ public Map getInstructorRemark() { if (null == instructorRemarkMap) { - instructorRemarkMap = JSON.parseObject(getString(KEY_INSTRUCTOR_REMARK), new TypeReference>() { - }); + String string = getString(KEY_INSTRUCTOR_REMARK); + if (!StringUtil.isEmpty(string)) { + instructorRemarkMap = JSON.parseObject(string, new TypeReference>() { + + }); + } } if (instructorRemarkMap == null) { instructorRemarkMap = new HashMap<>(); @@ -103,8 +111,8 @@ public class InstructorRemarkManager extends BaseCacheManager { public void run() { IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo(); HttpClient.getInstance().get("User.getInstructorRemark", "getInstructorRemark") - .params("uid", userInfo.getId(),true) - .params("token", userInfo.getToken(),true) + .params("uid", userInfo.getId(), true) + .params("token", userInfo.getToken(), true) .execute(new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { @@ -116,6 +124,11 @@ public class InstructorRemarkManager extends BaseCacheManager { } } + + @Override + public void onError(Response response) { + super.onError(response); + } });