Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Sobot_module_Dev
Project
Overview
Details
Activity
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
sobot_android
Sobot_module_Dev
Commits
f39482be
Commit
f39482be
authored
Jan 18, 2024
by
zhengnw@sobot.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common 1.5.8 添加 sdk 退出登录2
parent
19493fba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
SobotLoginTools.java
...src/main/java/com/sobot/common/login/SobotLoginTools.java
+6
-3
No files found.
sobot_common/src/main/java/com/sobot/common/login/SobotLoginTools.java
View file @
f39482be
...
@@ -153,8 +153,8 @@ public class SobotLoginTools {
...
@@ -153,8 +153,8 @@ public class SobotLoginTools {
public
boolean
checkExpiresToken
()
{
public
boolean
checkExpiresToken
()
{
if
(
getLoginUser
()
!=
null
)
{
if
(
getLoginUser
()
!=
null
)
{
long
difference
=
System
.
currentTimeMillis
()
-
getLoginUser
().
getLogin_time
();
long
difference
=
System
.
currentTimeMillis
()
-
getLoginUser
().
getLogin_time
();
SobotLogUtils
.
d
(
"检查token是否过期:上次登录距离当前的时间"
+
difference
);
if
(
getLoginUser
().
getLogin_time
()
>
0
&&
(
difference
>
12
*
60
*
60
*
1000
))
{
if
(
getLoginUser
().
getLogin_time
()
>
0
&&
(
difference
>
12
*
60
*
60
*
1000
))
{
SobotLogUtils
.
d
(
"上次登录距离当前的时间:"
+
difference
+
"ms,已经超过12小时,token已经过期"
);
return
false
;
return
false
;
}
}
}
}
...
@@ -458,10 +458,13 @@ public class SobotLoginTools {
...
@@ -458,10 +458,13 @@ public class SobotLoginTools {
// sdk 执行退出登录
// sdk 执行退出登录
public
void
logOut
(
Object
cancelTag
,
String
host
,
String
loginAcount
,
final
SobotResultBlock
resultBlock
)
{
public
void
logOut
(
Object
cancelTag
,
String
host
,
String
loginAcount
,
final
SobotResultBlock
resultBlock
)
{
if
(
SobotStringUtils
.
isEmpty
(
loginAcount
))
{
if
(
!
SobotStringUtils
.
isEmpty
(
loginAcount
)
&&
isLogin
(
loginAcount
))
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"loginUser"
,
loginAcount
);
params
.
put
(
"loginUser"
,
loginAcount
);
SobotHttpUtils
.
doPost
(
cancelTag
,
host
+
"/basic-login/serviceLogOut/4"
,
8000
,
params
,
null
,
new
HttpBaseUtils
.
StringCallBack
()
{
Map
<
String
,
String
>
headerParams
=
new
HashMap
<>();
headerParams
.
put
(
"temp-id"
,
getToken
());
headerParams
.
put
(
"from"
,
2
+
""
);
SobotHttpUtils
.
doPost
(
cancelTag
,
host
+
"/basic-login/serviceLogOut/4"
,
8000
,
params
,
headerParams
,
new
HttpBaseUtils
.
StringCallBack
()
{
@Override
@Override
public
void
onResponse
(
String
response
)
{
public
void
onResponse
(
String
response
)
{
SobotCallBaseCode
result
=
SobotGsonUtil
.
jsonToBean
(
response
,
SobotCallBaseCode
.
class
);
SobotCallBaseCode
result
=
SobotGsonUtil
.
jsonToBean
(
response
,
SobotCallBaseCode
.
class
);
...
...
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