Commit 05ac3e79 by 刘鹏

1.IM模块登录,接入优先一键登录功能

parent cce935af
...@@ -10,7 +10,7 @@ ext { ...@@ -10,7 +10,7 @@ ext {
"m-fm" : "0.0.30.00", "m-fm" : "0.0.30.00",
"m-user" : "0.0.60.91", "m-user" : "0.0.60.91",
"m-home" : "0.0.22.52", "m-home" : "0.0.22.52",
"m-im" : "0.0.18.33", "m-im" : "0.0.18.34",
"m-dynamic" : "0.0.7.13", "m-dynamic" : "0.0.7.13",
"m-article" : "0.0.0.6", "m-article" : "0.0.0.6",
...@@ -93,7 +93,7 @@ ext { ...@@ -93,7 +93,7 @@ ext {
"m-fm" : "0.0.23.5", "m-fm" : "0.0.23.5",
"m-user" : "0.0.60.91", "m-user" : "0.0.60.91",
"m-home" : "0.0.22.52", "m-home" : "0.0.22.52",
"m-im" : "0.0.3.15", "m-im" : "0.0.3.34",
"m-dynamic" : "0.0.1.7", "m-dynamic" : "0.0.1.7",
"m-muse" : "0.0.20.7", "m-muse" : "0.0.20.7",
......
...@@ -30,8 +30,8 @@ import com.yidianling.im.bridge.P2PCustomActionHandlerImpl ...@@ -30,8 +30,8 @@ import com.yidianling.im.bridge.P2PCustomActionHandlerImpl
import com.yidianling.im.config.constants.ImConstants import com.yidianling.im.config.constants.ImConstants
import com.yidianling.im.http.ImRetrofitApi.Companion.getImJavaApi import com.yidianling.im.http.ImRetrofitApi.Companion.getImJavaApi
import com.yidianling.im.http.ImRetrofitApi.Companion.getImRetrofitApi import com.yidianling.im.http.ImRetrofitApi.Companion.getImRetrofitApi
import com.yidianling.im.router.ImIn
import com.yidianling.im.router.ImIn.isLogin import com.yidianling.im.router.ImIn.isLogin
import com.yidianling.im.router.ImIn.loginWayIntent
import com.yidianling.im.session.SessionHelper import com.yidianling.im.session.SessionHelper
import com.yidianling.im.ui.page.fragment.bean.ChatItemBean import com.yidianling.im.ui.page.fragment.bean.ChatItemBean
import com.yidianling.uikit.business.session.fragment.YDLMessageFragment import com.yidianling.uikit.business.session.fragment.YDLMessageFragment
...@@ -278,7 +278,7 @@ object IMChatUtil { ...@@ -278,7 +278,7 @@ object IMChatUtil {
} else { } else {
upLoadLog("consult/get-expert", resp.code, resp.msg) upLoadLog("consult/get-expert", resp.code, resp.msg)
if (resp.code == ImConstants.HTTP_CODE_UNLOGIN) { if (resp.code == ImConstants.HTTP_CODE_UNLOGIN) {
context.startActivity(loginWayIntent(context)) ImIn.loginByOneKeyLogin(context,true)
ToastUtil.toastShort(resp.msg) ToastUtil.toastShort(resp.msg)
} else if (resp.code == ImConstants.SILENCED_CODE) { //禁言 } else if (resp.code == ImConstants.SILENCED_CODE) { //禁言
showSilencedDialog(context, resp.data.tips, resp.data.url) showSilencedDialog(context, resp.data.tips, resp.data.url)
...@@ -326,7 +326,7 @@ object IMChatUtil { ...@@ -326,7 +326,7 @@ object IMChatUtil {
} else { } else {
upLoadLog("consult/get-expert", resp.code, resp.msg) upLoadLog("consult/get-expert", resp.code, resp.msg)
if (resp.code == ImConstants.HTTP_CODE_UNLOGIN) { if (resp.code == ImConstants.HTTP_CODE_UNLOGIN) {
context.startActivity(loginWayIntent(context)) ImIn.loginByOneKeyLogin(context,true)
ToastUtil.toastShort(resp.msg) ToastUtil.toastShort(resp.msg)
} else if (resp.code == ImConstants.SILENCED_CODE) { //禁言 } else if (resp.code == ImConstants.SILENCED_CODE) { //禁言
showSilencedDialog(context, resp.data.tips, resp.data.url) showSilencedDialog(context, resp.data.tips, resp.data.url)
......
...@@ -70,8 +70,7 @@ class IMServiceImpl : IImService { ...@@ -70,8 +70,7 @@ class IMServiceImpl : IImService {
} }
override fun startP2PXiaoYi(context: Context) { override fun startP2PXiaoYi(context: Context) {
if (!ImIn.isLogin()) { if (!ImIn.loginByOneKeyLogin(context,true)) {
context.startActivity(ImIn.loginWayIntent(context))
return return
} }
SessionHelper.startP2PSession(context, -1, ImConstants.KEFUXIAOYI, null, P2PCustomActionHandlerImpl("14", "客服小壹", "https://static.ydlcdn.com/mobile/images/avatar_girl_app.png")) SessionHelper.startP2PSession(context, -1, ImConstants.KEFUXIAOYI, null, P2PCustomActionHandlerImpl("14", "客服小壹", "https://static.ydlcdn.com/mobile/images/avatar_girl_app.png"))
......
...@@ -103,7 +103,7 @@ object ImIn { ...@@ -103,7 +103,7 @@ object ImIn {
*/ */
fun isLogin(activity: Context,flag : Boolean):Boolean{ fun isLogin(activity: Context,flag : Boolean):Boolean{
if (!isLogin() && flag) { if (!isLogin() && flag) {
YDLRouterManager.router(IYDLRouterConstant.ROUTER_MINE_LOGIN) getUserService().loginByOneKeyLogin(activity,true)
return false return false
}else{ }else{
return true return true
...@@ -293,4 +293,12 @@ object ImIn { ...@@ -293,4 +293,12 @@ object ImIn {
fun getGlobalInfo(): GlobalInfo? { fun getGlobalInfo(): GlobalInfo? {
return PlatformDataManager.getRam().getGlobalInfo() return PlatformDataManager.getRam().getGlobalInfo()
} }
/**
* 调用优先使用一键登录,并返回调用时的登录状态,
* @param isOpenDialog true:一键登录使用弹窗展示 false:一键登录使用全屏模式
* @return true:已登录,不触发登录跳转,false:未登录,优先一键登录
* */
fun loginByOneKeyLogin(context: Context, isOpenDialog: Boolean) :Boolean{
return getUserService().loginByOneKeyLogin(context,isOpenDialog)
}
} }
...@@ -280,7 +280,7 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener { ...@@ -280,7 +280,7 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
ll_chat_unusual_view.setUnusualType(ChatUnusualView.TYPE_UNLOGIN) ll_chat_unusual_view.setUnusualType(ChatUnusualView.TYPE_UNLOGIN)
ll_chat_unusual_view.setListener(object : ChatUnusualView.ChatUnusualListener { ll_chat_unusual_view.setListener(object : ChatUnusualView.ChatUnusualListener {
override fun onButtonClick() { override fun onButtonClick() {
context.startActivity(ImIn.loginWayIntent(context)) ImIn.loginByOneKeyLogin(context,true)
} }
}) })
} }
......
...@@ -196,7 +196,7 @@ class InteractFragment : BaseFragment(), XRecyclerView.LoadingListener { ...@@ -196,7 +196,7 @@ class InteractFragment : BaseFragment(), XRecyclerView.LoadingListener {
ll_interact_unusual_view.setUnusualType(ChatUnusualView.TYPE_UNLOGIN) ll_interact_unusual_view.setUnusualType(ChatUnusualView.TYPE_UNLOGIN)
ll_interact_unusual_view.setListener(object : ChatUnusualView.ChatUnusualListener { ll_interact_unusual_view.setListener(object : ChatUnusualView.ChatUnusualListener {
override fun onButtonClick() { override fun onButtonClick() {
context.startActivity(ImIn.loginWayIntent(context)) ImIn.loginByOneKeyLogin(context,true)
} }
}) })
} }
......
...@@ -120,7 +120,7 @@ class NoticeFragment : BaseFragment(), XRecyclerView.LoadingListener { ...@@ -120,7 +120,7 @@ class NoticeFragment : BaseFragment(), XRecyclerView.LoadingListener {
ll_notice_unusual_view.setUnusualType(ChatUnusualView.TYPE_UNLOGIN) ll_notice_unusual_view.setUnusualType(ChatUnusualView.TYPE_UNLOGIN)
ll_notice_unusual_view.setListener(object : ChatUnusualView.ChatUnusualListener { ll_notice_unusual_view.setListener(object : ChatUnusualView.ChatUnusualListener {
override fun onButtonClick() { override fun onButtonClick() {
context.startActivity(ImIn.loginWayIntent(context)) ImIn.loginByOneKeyLogin(context,true)
} }
}) })
} }
......
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