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