Commit 88a9137f by zhengnw@sobot.com

common 1.5.8 退出登录3

parent e19cd947
...@@ -458,7 +458,18 @@ public class SobotLoginTools { ...@@ -458,7 +458,18 @@ 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) && isLogin(loginAcount)) { if (SobotStringUtils.isEmpty(loginAcount)) {
if (resultBlock != null) {
resultBlock.resultBolok(SobotResultCode.CODE_FAILED, "账号为空,退出失败", null);
}
return;
}
if (!isLogin(loginAcount)) {
if (resultBlock != null) {
resultBlock.resultBolok(SobotResultCode.CODE_SUCCEEDED, "上次登录的保存信息为空,不用再次退出登录", null);
}
return;
}
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("loginUser", loginAcount); params.put("loginUser", loginAcount);
Map<String, String> headerParams = new HashMap<>(); Map<String, String> headerParams = new HashMap<>();
...@@ -492,11 +503,6 @@ public class SobotLoginTools { ...@@ -492,11 +503,6 @@ public class SobotLoginTools {
} }
}); });
} else {
if (resultBlock != null) {
resultBlock.resultBolok(SobotResultCode.CODE_FAILED, "账号为空,退出失败", null);
}
}
} }
...@@ -509,7 +515,8 @@ public class SobotLoginTools { ...@@ -509,7 +515,8 @@ public class SobotLoginTools {
* @param token * @param token
* @param resultBlock * @param resultBlock
*/ */
public void getLoginUserInfo(final Object cancelTag, final Context mContext, final String host, String token, String language, final SobotResultBlock resultBlock) { public void getLoginUserInfo(final Object cancelTag, final Context mContext,
final String host, String token, String language, final SobotResultBlock resultBlock) {
final String url = host + "/basic-config-service/consoleAuth/queryAppAgentMenus"; final String url = host + "/basic-config-service/consoleAuth/queryAppAgentMenus";
Map<String, String> headerMap = new HashMap<>(); Map<String, String> headerMap = new HashMap<>();
if (!SobotStringUtils.isEmpty(token)) { if (!SobotStringUtils.isEmpty(token)) {
...@@ -607,7 +614,8 @@ public class SobotLoginTools { ...@@ -607,7 +614,8 @@ public class SobotLoginTools {
* 获取accessToken * 获取accessToken
*/ */
public void doAccessToken(Object cancelTag, String host, String token, final SobotResultBlock resultBlock) { public void doAccessToken(Object cancelTag, String host, String token,
final SobotResultBlock resultBlock) {
Map<String, String> headerMap = new HashMap<>(); Map<String, String> headerMap = new HashMap<>();
if (!SobotStringUtils.isEmpty(token)) { if (!SobotStringUtils.isEmpty(token)) {
headerMap.put("temp-id", token); headerMap.put("temp-id", token);
......
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