Commit 1d984252 authored by yinjiacheng's avatar yinjiacheng

update C端调用B端API登录失效处理

parent 7ca66d04
...@@ -71,15 +71,14 @@ abstract class HttpResultObserver<T> : Observer<HttpResult<T>> { ...@@ -71,15 +71,14 @@ abstract class HttpResultObserver<T> : Observer<HttpResult<T>> {
if (JudgeClientUtils.judgeClient(YdBaseApplication.context.packageName) == ClientType.MERCHANT_B) { if (JudgeClientUtils.judgeClient(YdBaseApplication.context.packageName) == ClientType.MERCHANT_B) {
XPageManager.push(XRouterPathConstants.LOGIN_LIFE_CIRCLE, null) XPageManager.push(XRouterPathConstants.LOGIN_LIFE_CIRCLE, null)
} else { } else {
ZapTicket(ZapServiceNameConstants.ClientInfoService).withAction(ZapServiceActionConstants.ActionGetLoginStatus) ZapTicket(ZapServiceNameConstants.ClientInfoService).withAction(ZapServiceActionConstants.ActionGotoLogin).onResult {
.withServiceParams(JSONObject().put("needLogin", true)).onResult { val loginResult = (it.result as JSONObject).optBoolean("loginResult")
val loginStatus = (it.result as JSONObject).optBoolean("loginStatus") if (loginResult) {
if (loginStatus) { XPageManager.popTo(XRouterPathConstants.MERCHANT_CENTER, null)
XPageManager.popTo(XRouterPathConstants.MERCHANT_CENTER, null) // 通知登录成功
// 通知登录成功 XEventManager.post(XBaseEvent(XEventConfig.CLIENT_C_LOGIN_SUCCESS, null))
XEventManager.post(XBaseEvent(XEventConfig.CLIENT_C_LOGIN_SUCCESS, null)) }
} }.ship()
}.ship()
} }
} }
else -> { else -> {
......
...@@ -68,15 +68,14 @@ abstract class HttpResultSubscriber<T>(private var showProgress: Boolean = false ...@@ -68,15 +68,14 @@ abstract class HttpResultSubscriber<T>(private var showProgress: Boolean = false
if (JudgeClientUtils.judgeClient(YdBaseApplication.context.packageName) == ClientType.MERCHANT_B) { if (JudgeClientUtils.judgeClient(YdBaseApplication.context.packageName) == ClientType.MERCHANT_B) {
XPageManager.push(XRouterPathConstants.LOGIN_LIFE_CIRCLE, null) XPageManager.push(XRouterPathConstants.LOGIN_LIFE_CIRCLE, null)
} else { } else {
ZapTicket(ZapServiceNameConstants.ClientInfoService).withAction(ZapServiceActionConstants.ActionGetLoginStatus) ZapTicket(ZapServiceNameConstants.ClientInfoService).withAction(ZapServiceActionConstants.ActionGotoLogin).onResult {
.withServiceParams(JSONObject().put("needLogin", true)).onResult { val loginResult = (it.result as JSONObject).optBoolean("loginResult")
val loginStatus = (it.result as JSONObject).optBoolean("loginStatus") if (loginResult) {
if (loginStatus) { XPageManager.popTo(XRouterPathConstants.MERCHANT_CENTER, null)
XPageManager.popTo(XRouterPathConstants.MERCHANT_CENTER, null) // 通知登录成功
// 通知登录成功 XEventManager.post(XBaseEvent(XEventConfig.CLIENT_C_LOGIN_SUCCESS, null))
XEventManager.post(XBaseEvent(XEventConfig.CLIENT_C_LOGIN_SUCCESS, null)) }
} }.ship()
}.ship()
} }
} }
else -> { else -> {
......
...@@ -72,5 +72,8 @@ class ZapServiceActionConstants { ...@@ -72,5 +72,8 @@ class ZapServiceActionConstants {
// C端上传埋点日志 // C端上传埋点日志
const val CommitCPointLog = "commitCPointLog" const val CommitCPointLog = "commitCPointLog"
// 跳转C端登录页
const val ActionGotoLogin = "gotoLogin"
} }
} }
...@@ -61,6 +61,13 @@ class ClientInfoService : ZapService() { ...@@ -61,6 +61,13 @@ class ClientInfoService : ZapService() {
.put("loginStatus", true) .put("loginStatus", true)
) )
} }
// 跳转C端登录页
ZapServiceActionConstants.ActionGotoLogin -> {
resolver.success(
JSONObject()
.put("loginResult", 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