fix:401处理策略调整(仅发送事件会有意外的bug,改用清除本地登录信息+事件)

This commit is contained in:
Max
2023-11-20 16:33:12 +08:00
parent ef5e0a8f59
commit 865dbb09b6
5 changed files with 3 additions and 10 deletions

View File

@@ -411,6 +411,7 @@ public class MainActivity extends BaseMvpActivity<IMainView, MainPresenter>
}
onParseIntent();
handleNimIntent();
InitialModel.get().regionCheck();
}
private void onParseIntent() {

View File

@@ -3,7 +3,6 @@ package com.yizhuan.habu.application;
import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUSTOM_MSG_HEADER_TYPE_OPEN_ROOM_NOTI;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.graphics.Color;
@@ -40,7 +39,6 @@ import com.scwang.smartrefresh.header.MaterialHeader;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.footer.ClassicsFooter;
import com.tencent.vasdolly.helper.ChannelReaderUtil;
import com.yizhuan.habu.AgentActivity;
import com.yizhuan.habu.BuildConfig;
import com.yizhuan.habu.NimMiddleActivity;
import com.yizhuan.habu.R;
@@ -54,7 +52,6 @@ import com.yizhuan.xchat_android_core.Constants;
import com.yizhuan.xchat_android_core.DemoCache;
import com.yizhuan.xchat_android_core.UriProvider;
import com.yizhuan.xchat_android_core.auth.AuthModel;
import com.yizhuan.xchat_android_core.auth.event.LogoutEvent;
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
import com.yizhuan.xchat_android_core.channel.ChannelModel;
import com.yizhuan.xchat_android_core.family.model.FamilyModel;
@@ -245,7 +242,7 @@ public class XChatApplication extends BaseApp {
throw new ServerException(serviceResult.getMessage(), serviceResult.getCode());
} else if (serviceResult.getCode() == 401) {
SingleToastUtil.showToast(serviceResult.getMessage());
EventBus.getDefault().post(new LogoutEvent());
AuthModel.get().cleanLogInfo();
throw new ServerException(serviceResult.getMessage(), serviceResult.getCode());
}
}