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
19493fba
Commit
19493fba
authored
Jan 18, 2024
by
zhengnw@sobot.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common 1.5.8 添加 sdk 退出登录
parent
01c647f6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
2 deletions
+49
-2
sobot-common-publish-mavencentral.gradle
sobot_common/sobot-common-publish-mavencentral.gradle
+1
-1
SobotLoginTools.java
...src/main/java/com/sobot/common/login/SobotLoginTools.java
+48
-1
No files found.
sobot_common/sobot-common-publish-mavencentral.gradle
View file @
19493fba
...
...
@@ -12,7 +12,7 @@ task androidSourcesJar(type: Jar) {
ext
{
PUBLISH_GROUP_ID
=
"com.sobot.library"
//项目包名
PUBLISH_ARTIFACT_ID
=
'sobotcommon_x'
//项目名
PUBLISH_VERSION
=
'1.5.
7
'
//版本号
PUBLISH_VERSION
=
'1.5.
8
'
//版本号
}
...
...
sobot_common/src/main/java/com/sobot/common/login/SobotLoginTools.java
View file @
19493fba
package
com
.
sobot
.
common
.
login
;
import
android.content.Context
;
import
android.text.TextUtils
;
import
com.sobot.common.login.callback.SobotResultBlock
;
import
com.sobot.common.login.callback.SobotResultCode
;
...
...
@@ -118,6 +117,14 @@ public class SobotLoginTools {
}
}
//清除登录信息
public
void
clearLoginInfo
()
{
user
=
null
;
mServiceInfoModel
=
null
;
LoginUserManager
.
getInstance
().
deleteAll
();
ServiceInfoManager
.
getInstance
().
deleteAll
();
}
//呼叫 v6 获取 accessToken
public
String
getAccessToken
()
{
if
(
getLoginUser
()
!=
null
)
{
...
...
@@ -449,6 +456,46 @@ public class SobotLoginTools {
}
}
// sdk 执行退出登录
public
void
logOut
(
Object
cancelTag
,
String
host
,
String
loginAcount
,
final
SobotResultBlock
resultBlock
)
{
if
(
SobotStringUtils
.
isEmpty
(
loginAcount
))
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"loginUser"
,
loginAcount
);
SobotHttpUtils
.
doPost
(
cancelTag
,
host
+
"/basic-login/serviceLogOut/4"
,
8000
,
params
,
null
,
new
HttpBaseUtils
.
StringCallBack
()
{
@Override
public
void
onResponse
(
String
response
)
{
SobotCallBaseCode
result
=
SobotGsonUtil
.
jsonToBean
(
response
,
SobotCallBaseCode
.
class
);
if
(
result
!=
null
&&
!
SobotStringUtils
.
isEmpty
(
result
.
getRetCode
())
&&
"000000"
.
equals
(
result
.
getRetCode
()))
{
clearLoginInfo
();
if
(
resultBlock
!=
null
)
{
resultBlock
.
resultBolok
(
SobotResultCode
.
CODE_FAILED
,
"退出登录成功"
,
null
);
}
}
else
{
if
(
resultBlock
!=
null
)
{
resultBlock
.
resultBolok
(
SobotResultCode
.
CODE_FAILED
,
(
result
!=
null
&&
SobotStringUtils
.
isNoEmpty
(
result
.
getRetMsg
()))
?
result
.
getRetMsg
()
:
"退出登录失败"
,
null
);
}
}
}
@Override
public
void
onError
(
Exception
e
,
String
msg
,
int
responseCode
)
{
if
(
resultBlock
!=
null
)
{
resultBlock
.
resultBolok
(
SobotResultCode
.
CODE_FAILED
,
msg
,
null
);
}
}
@Override
public
void
inProgress
(
int
progress
)
{
}
});
}
else
{
if
(
resultBlock
!=
null
)
{
resultBlock
.
resultBolok
(
SobotResultCode
.
CODE_FAILED
,
"账号为空,退出失败"
,
null
);
}
}
}
/**
* 调用座席接口
...
...
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