Commit b23df313 by 刘鹏

Merge branch 'feat/lp/lp_login_2' into 'd/4.4.10'

feat: 声网login更改

See merge request app_android_lib/YDL-Component!351
parents 9d53d32a ac953120
......@@ -14,7 +14,7 @@ buildscript {
ydlrouter_version = '1.2.3'
constrait_support_version = '1.0.2'
componentVersion = "0.3.0.48.1-SNAPSHOT"
componentVersion = "0.3.0.48.4-SNAPSHOT"
}
repositories {
mavenCentral()
......
......@@ -34,7 +34,6 @@ import com.ydl.ydlcommon.utils.log.AliYunLogConfig
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import com.ydl.ydlcommon.utils.log.LogHelper
import com.yidianling.im.api.bean.IMSendCustomNotificationResultCallBack
import com.yidianling.user.api.event.UserLoginEvent
import com.yidianling.user.api.event.UserLogoutEvent
import com.yidianling.user.api.service.IUserService
import de.greenrobot.event.EventBus
......@@ -72,8 +71,9 @@ class YDLavManager {
fun init(context: Context, appId: String) {
YDLRTMClient.instances.init(context, appId, listener)
EventBus.getDefault().unregister(this)
EventBus.getDefault().register(this)
if (!EventBus.getDefault().isRegistered(this)) {
EventBus.getDefault().register(this)
}
//设置回调
setCallback()
......@@ -86,10 +86,6 @@ class YDLavManager {
}
}
public fun onEvent(event: UserLoginEvent) {
instances.login(event.uid)
}
public fun onEvent(event: UserLogoutEvent) {
instances.logout()
}
......@@ -383,6 +379,9 @@ class YDLavManager {
}
fun login(userId: String?) {
if (!EventBus.getDefault().isRegistered(this)) {
EventBus.getDefault().register(this)
}
login(userId) { _, _ ->
}
}
......
......@@ -77,5 +77,4 @@ dependencies {
implementation project(":api:fm")
implementation project(":api:consultant")
implementation project(':api:confide')
implementation project(':api:audioim')
}
......@@ -2,8 +2,6 @@ package com.yidianling.im.helper;
import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.auth.AuthService;
import com.ydl.audioim.api.IAudioImService;
import com.ydl.ydlcommon.modular.ModularServiceManagerKt;
import com.yidianling.im.preference.IMCache;
import com.yidianling.nimbase.common.http.NimHttpClient;
import com.yidianling.uikit.api.NimUIKit;
......@@ -19,7 +17,6 @@ public class LogoutHelper {
NimUIKit.logout();
IMCache.clear();
NIMClient.getService(AuthService.class).logout();
ModularServiceManagerKt.findRouteService(IAudioImService.class).logoutRtm();
}
private static LogoutHelper instance;
......
......@@ -10,14 +10,15 @@ import android.widget.ToggleButton;
import com.umeng.socialize.UMAuthListener;
import com.umeng.socialize.UMShareAPI;
import com.umeng.socialize.bean.SHARE_MEDIA;
import com.ydl.audioim.api.IAudioImService;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.bean.StatusBarOptions;
import com.ydl.ydlcommon.data.http.ThrowableConsumer;
import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.ydl.ydlcommon.modular.ModularServiceManagerKt;
import com.ydl.ydlcommon.router.YdlCommonOut;
import com.ydl.ydlcommon.utils.LogUtil;
import com.ydl.ydlcommon.utils.SharedPreferencesEditor;
import com.ydl.ydlcommon.utils.remind.ToastHelper;
import com.ydl.ydlcommon.view.JumpTextView;
......@@ -299,8 +300,10 @@ public class AccountSettingActivity extends BaseActivity implements View.OnClick
//清除UserInfo
UserHelper.INSTANCE.setUserinfo(null);
UserIn.INSTANCE.clearImData();
ModularServiceManagerKt.findRouteService(IAudioImService.class).logoutRtm();
ModularServiceManagerKt.findRouteService(IImService.class).logoutAll();
LoginUtils.logout();
EventBus.getDefault().post(new RefreshRecentContactListEvent());
finish();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment