Commit aed79e4a by zhengnw@sobot.com

common 登录接口添加语言

parent 0b7f3e95
...@@ -8,7 +8,7 @@ android { ...@@ -8,7 +8,7 @@ android {
defaultConfig { defaultConfig {
applicationId "com.sobot.moduletest" applicationId "com.sobot.moduletest"
minSdkVersion 16 minSdkVersion 17
targetSdkVersion 29 targetSdkVersion 29
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
......
...@@ -11,7 +11,7 @@ android { ...@@ -11,7 +11,7 @@ android {
//这里就是打jar包 //这里就是打jar包
task makeJar(type: Copy) { task makeJar(type: Copy) {
//删除旧的jar包 //删除旧的jar包
delete 'build/libs/sobot_common_1.3.1.jar' delete 'build/libs/sobot_common_1.3.4.jar'
//原地址 //原地址
from('build/intermediates/packaged-classes/release/') from('build/intermediates/packaged-classes/release/')
//导出jar包的地址 //导出jar包的地址
...@@ -19,7 +19,7 @@ android { ...@@ -19,7 +19,7 @@ android {
//包含的jar包 //包含的jar包
include('classes.jar') include('classes.jar')
//重命名jar包为mysdk //重命名jar包为mysdk
rename ('classes.jar', 'sobot_common_1.3.1.jar') rename ('classes.jar', 'sobot_common_1.3.4.jar')
} }
makeJar.dependsOn(build) makeJar.dependsOn(build)
} }
......
...@@ -13,7 +13,7 @@ ext { ...@@ -13,7 +13,7 @@ ext {
PUBLISH_GROUP_ID = "com.sobot.library" //项目包名 PUBLISH_GROUP_ID = "com.sobot.library" //项目包名
PUBLISH_ARTIFACT_ID = 'sobotcommon' //项目名 PUBLISH_ARTIFACT_ID = 'sobotcommon' //项目名
// PUBLISH_ARTIFACT_ID = 'sobotcommon_x' //项目名 // PUBLISH_ARTIFACT_ID = 'sobotcommon_x' //项目名
PUBLISH_VERSION = '1.3.3' //版本号 PUBLISH_VERSION = '1.3.4' //版本号
} }
......
...@@ -52,8 +52,8 @@ public class SobotLoginTools { ...@@ -52,8 +52,8 @@ public class SobotLoginTools {
} }
// 执行APP登录接口 // 执行APP登录接口
public static void doAppLogin(final Object cancelTag, final Context mContext, final String host,long timeout, Map<String, Object> params, Map<String, String> headers, final SobotResultBlock resultBlock) { public static void doAppLogin(final Object cancelTag, final Context mContext, final String host, long timeout, Map<String, Object> params, Map<String, String> headers, final SobotResultBlock resultBlock) {
SobotHttpUtils.doPost(cancelTag, host + "/chat-sdk/sdk/admin/v1/login.action", timeout,params, headers, new HttpBaseUtils.StringCallBack() { SobotHttpUtils.doPost(cancelTag, host + "/chat-sdk/sdk/admin/v1/login.action", timeout, params, headers, new HttpBaseUtils.StringCallBack() {
@Override @Override
public void onResponse(String result) { public void onResponse(String result) {
if (!TextUtils.isEmpty(result)) { if (!TextUtils.isEmpty(result)) {
...@@ -63,7 +63,7 @@ public class SobotLoginTools { ...@@ -63,7 +63,7 @@ public class SobotLoginTools {
//登录接口和获取坐席信息权限接口都成功才算真正登录成功 //登录接口和获取坐席信息权限接口都成功才算真正登录成功
if ("1".equals(baseModel.getCode()) && baseModel.getData() != null) { if ("1".equals(baseModel.getCode()) && baseModel.getData() != null) {
LoginUserInfoUtils.setUser(baseModel.getData()); LoginUserInfoUtils.setUser(baseModel.getData());
getLoginUserInfo(cancelTag, mContext, baseModel.getData(), host, baseModel.getData().getToken(), resultBlock); getLoginUserInfo(cancelTag, mContext, baseModel.getData(), host, baseModel.getData().getToken(), baseModel.getData().getLanguage(), resultBlock);
} else { } else {
resultBlock.resultBolok(SobotResultCode.CODE_FAILED, baseModel.getMsg(), baseModel.getCode()); resultBlock.resultBolok(SobotResultCode.CODE_FAILED, baseModel.getMsg(), baseModel.getCode());
} }
...@@ -94,8 +94,8 @@ public class SobotLoginTools { ...@@ -94,8 +94,8 @@ public class SobotLoginTools {
* @param token * @param token
* @param resultBlock 返回坐席信息 * @param resultBlock 返回坐席信息
*/ */
public static void getLoginUserInfo(final Object cancelTag, final Context mContext, String host, final String token, final SobotResultBlock resultBlock) { public static void getLoginUserInfo(Object cancelTag, Context mContext, String host, String token, String language, SobotResultBlock resultBlock) {
getLoginUserInfo(cancelTag, mContext, null, host, token, resultBlock); getLoginUserInfo(cancelTag, mContext, null, host, token, language, resultBlock);
} }
/** /**
...@@ -108,10 +108,15 @@ public class SobotLoginTools { ...@@ -108,10 +108,15 @@ public class SobotLoginTools {
* @param token * @param token
* @param resultBlock * @param resultBlock
*/ */
public static void getLoginUserInfo(final Object cancelTag, final Context mContext, final LoginUserEntity loginUser, String host, final String token, final SobotResultBlock resultBlock) { public static void getLoginUserInfo(Object cancelTag, final Context mContext, final LoginUserEntity loginUser, 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<>();
headerMap.put("temp-id", token); if (!TextUtils.isEmpty(token)) {
headerMap.put("temp-id", token);
}
if (!TextUtils.isEmpty(language)) {
headerMap.put("language", language);
}
SobotHttpUtils.doGet(cancelTag, url, null, headerMap, new HttpBaseUtils.StringCallBack() { SobotHttpUtils.doGet(cancelTag, url, null, headerMap, new HttpBaseUtils.StringCallBack() {
@Override @Override
public void onResponse(String result) { public void onResponse(String result) {
......
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