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