Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
ShenghuoquanBusiness
Commits
1d984252
Commit
1d984252
authored
Sep 08, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update C端调用B端API登录失效处理
parent
7ca66d04
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
18 deletions
+26
-18
HttpResultObserver.kt
...c/main/java/com/yidian/bcommon/http/HttpResultObserver.kt
+8
-9
HttpResultSubscriber.kt
...main/java/com/yidian/bcommon/http/HttpResultSubscriber.kt
+8
-9
ZapServiceActionConstants.kt
.../com/yidian/bcommon/services/ZapServiceActionConstants.kt
+3
-0
ClientInfoService.kt
...om/yidian/shenghuoquan/bdemo/service/ClientInfoService.kt
+7
-0
No files found.
CommonLib/BCommon/src/main/java/com/yidian/bcommon/http/HttpResultObserver.kt
View file @
1d984252
...
...
@@ -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
->
{
...
...
CommonLib/BCommon/src/main/java/com/yidian/bcommon/http/HttpResultSubscriber.kt
View file @
1d984252
...
...
@@ -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
->
{
...
...
CommonLib/BCommon/src/main/java/com/yidian/bcommon/services/ZapServiceActionConstants.kt
View file @
1d984252
...
...
@@ -72,5 +72,8 @@ class ZapServiceActionConstants {
// C端上传埋点日志
const
val
CommitCPointLog
=
"commitCPointLog"
// 跳转C端登录页
const
val
ActionGotoLogin
=
"gotoLogin"
}
}
Components/BDemo/src/main/java/com/yidian/shenghuoquan/bdemo/service/ClientInfoService.kt
View file @
1d984252
...
...
@@ -61,6 +61,13 @@ class ClientInfoService : ZapService() {
.
put
(
"loginStatus"
,
true
)
)
}
// 跳转C端登录页
ZapServiceActionConstants
.
ActionGotoLogin
->
{
resolver
.
success
(
JSONObject
()
.
put
(
"loginResult"
,
true
)
)
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment