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); + } });