修复指导员切换账号提示问题

This commit is contained in:
18401019693 2022-08-15 15:40:03 +08:00
parent a453a526fa
commit 1d660f6f39
2 changed files with 10 additions and 2 deletions

View File

@ -178,6 +178,8 @@ public class IMLoginManager extends BaseCacheManager {
deleteByKey(KEY_USER_INFO);
deleteByKey(isNewUserGif);
deleteByKey(isNewUserOne);
//清理指导员信息
NoviceInstructorManager.get(context).deleteOfLogin();
//用户对象置空
userInfo = null;
manager = null;

View File

@ -109,10 +109,10 @@ public class NoviceInstructorManager extends BaseCacheManager {
//只有和指导员对话才可以清除信息
UserInfo model1 = RongUserInfoManager.getInstance().getUserInfo(targetId);
IMLoginModel userModel = new Gson().fromJson(model1.getExtra(), IMLoginModel.class);
if (userModel!=null&&TextUtils.equals(userModel.getIsAdmin(), "1")) {
if (userModel != null && TextUtils.equals(userModel.getIsAdmin(), "1")) {
IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo();
HttpClient.getInstance().get("Message.setZdyMsg", "setZdyMsg")
.params("uid", userInfo.getId(),true)
.params("uid", userInfo.getId(), true)
.execute(new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
@ -124,6 +124,12 @@ public class NoviceInstructorManager extends BaseCacheManager {
}
}
//登出时清理指导员信息
public void deleteOfLogin() {
deleteByKey(KEY_NOVICE_INSTRUCTOR);
EventBus.getDefault().post(new NoviceInstructorEvent().setShowHomeIcon(false));
}
/**
* 请求接口获取是否展示
*/