Commit d8142a78 by zhengnw@sobot.com

登录权限修改 从表里取值

parent d9013215
...@@ -41,7 +41,7 @@ dependencies { ...@@ -41,7 +41,7 @@ dependencies {
// api 'com.sobot.library:sobotcommon_x:1.0' // api 'com.sobot.library:sobotcommon_x:1.0'
implementation 'com.github.bumptech.glide:glide:4.9.0' implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.sobot.chat:sobotsupport-glidev4:3.1' implementation 'com.sobot.chat:sobotsupport-glidev4:2.3'
// implementation 'com.facebook.fresco:fresco:1.13.0' // implementation 'com.facebook.fresco:fresco:1.13.0'
//android x 可以用这个 ,普通版不能用这个 //android x 可以用这个 ,普通版不能用这个
// implementation 'com.facebook.fresco:fresco:2.6.0' // implementation 'com.facebook.fresco:fresco:2.6.0'
......
...@@ -23,7 +23,7 @@ dependencies { ...@@ -23,7 +23,7 @@ dependencies {
compileOnly 'androidx.appcompat:appcompat:1.0.0' compileOnly 'androidx.appcompat:appcompat:1.0.0'
compileOnly 'androidx.recyclerview:recyclerview:1.0.0' compileOnly 'androidx.recyclerview:recyclerview:1.0.0'
api 'com.sobot.library:widget_x:1.2.1' api 'com.sobot.library:widget_x:1.2.1'
api 'com.sobot.library:picture_x:1.1.9' api 'com.sobot.library:picture_x:1.2.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_x_1.6.8.jar' delete 'build/libs/sobot_common_x_1.7.0.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_x_1.6.8.jar') rename ('classes.jar', 'sobot_common_x_1.7.0.jar')
} }
makeJar.dependsOn(build) makeJar.dependsOn(build)
} }
...@@ -34,8 +34,8 @@ dependencies { ...@@ -34,8 +34,8 @@ dependencies {
api 'com.sobot.library:utils:1.1.3' api 'com.sobot.library:utils:1.1.3'
api 'com.sobot.library:picture_x:1.1.9' api 'com.sobot.library:picture_x:1.2.0'
api 'com.sobot.library:net:1.2.2' api 'com.sobot.library:net:1.2.5'
api 'com.sobot.library:gson:1.1.1' api 'com.sobot.library:gson:1.1.1'
} }
......
...@@ -12,7 +12,7 @@ task androidSourcesJar(type: Jar) { ...@@ -12,7 +12,7 @@ task androidSourcesJar(type: Jar) {
ext { ext {
PUBLISH_GROUP_ID = "com.sobot.library" //项目包名 PUBLISH_GROUP_ID = "com.sobot.library" //项目包名
PUBLISH_ARTIFACT_ID = 'sobotcommon_x' //项目名 PUBLISH_ARTIFACT_ID = 'sobotcommon_x' //项目名
PUBLISH_VERSION = '1.6.8' //版本号 PUBLISH_VERSION = '1.7.0' //版本号
} }
......
...@@ -62,8 +62,8 @@ public class SobotLoginTools { ...@@ -62,8 +62,8 @@ public class SobotLoginTools {
//获取权限列表 //获取权限列表
public List<ServiceFunctionVoModel> getServiceFunctionVoModel() { public List<ServiceFunctionVoModel> getServiceFunctionVoModel() {
if (functionVoModelList == null && ServiceInfoManager.getInstance().getInfo() != null) { if (functionVoModelList == null && FunctionManager.getInstance().getFunctionVos() != null) {
functionVoModelList = ServiceInfoManager.getInstance().getInfo().getFunctionStr(); functionVoModelList = FunctionManager.getInstance().getFunctionVos();
} }
if (functionVoModelList == null) { if (functionVoModelList == null) {
functionVoModelList = new ArrayList<>(); functionVoModelList = new ArrayList<>();
...@@ -726,7 +726,6 @@ public class SobotLoginTools { ...@@ -726,7 +726,6 @@ public class SobotLoginTools {
} }
} }
} }
serviceInfoModel.setFunctionStr(functions);
//权限保存入库 //权限保存入库
FunctionManager.getInstance().setFunctionVos(functions); FunctionManager.getInstance().setFunctionVos(functions);
//先保存一次 //先保存一次
...@@ -839,7 +838,7 @@ public class SobotLoginTools { ...@@ -839,7 +838,7 @@ public class SobotLoginTools {
if (infoModel != null) { if (infoModel != null) {
Map<String, String> headers = new HashMap<>(); Map<String, String> headers = new HashMap<>();
headers.put("token", SobotStringUtils.checkStringIsNull(infoModel.getToken())); headers.put("token", SobotStringUtils.checkStringIsNull(infoModel.getToken()));
headers.put("language", SobotStringUtils.checkStringIsNull(infoModel.getLanguage())); headers.put("language", SobotStringUtils.checkStringIsNull(infoModel.getServiceLanguage()));
SobotHttpUtils.doPost(cancelTag, host + "/chat-sdk/sdk/admin/v1/appLogin", 8000, params, headers, new HttpBaseUtils.StringCallBack() { SobotHttpUtils.doPost(cancelTag, host + "/chat-sdk/sdk/admin/v1/appLogin", 8000, params, headers, new HttpBaseUtils.StringCallBack() {
@Override @Override
public void onResponse(String result) { public void onResponse(String result) {
......
...@@ -78,15 +78,14 @@ public class ServiceInfoManager extends SobotCommonDao<SobotServiceInfoModel> { ...@@ -78,15 +78,14 @@ public class ServiceInfoManager extends SobotCommonDao<SobotServiceInfoModel> {
model.setRobotVersion(cursor.getInt(cursor.getColumnIndex("robotVersion")) + ""); model.setRobotVersion(cursor.getInt(cursor.getColumnIndex("robotVersion")) + "");
model.setOnlineVersion(cursor.getInt(cursor.getColumnIndex("onlineVersion")) + ""); model.setOnlineVersion(cursor.getInt(cursor.getColumnIndex("onlineVersion")) + "");
model.setCompanyId(cursor.getString(cursor.getColumnIndex("companyId"))); model.setCompanyId(cursor.getString(cursor.getColumnIndex("companyId")));
model.setLanguage(cursor.getString(cursor.getColumnIndex("local_language")));
model.setAccess_token(cursor.getString(cursor.getColumnIndex(SobotServiceInfoModel.ACCESS_TOKEN))); model.setAccess_token(cursor.getString(cursor.getColumnIndex(SobotServiceInfoModel.ACCESS_TOKEN)));
model.setLogin_time(cursor.getLong(cursor.getColumnIndex(SobotServiceInfoModel.LOGIN_TIME))); model.setLogin_time(cursor.getLong(cursor.getColumnIndex(SobotServiceInfoModel.LOGIN_TIME)));
model.setLoginAccount(cursor.getString(cursor.getColumnIndex("login_account"))); model.setLoginAccount(cursor.getString(cursor.getColumnIndex("login_account")));
model.setLoginPwd(cursor.getString(cursor.getColumnIndex("login_pwd"))); model.setLoginPwd(cursor.getString(cursor.getColumnIndex("login_pwd")));
model.setWslinkDefault(cursor.getString(cursor.getColumnIndex("wslinkDefault"))); model.setWslinkDefault(cursor.getString(cursor.getColumnIndex("wslinkDefault")));
model.setServiceId(cursor.getString(cursor.getColumnIndex("serviceId"))); model.setServiceId(cursor.getString(cursor.getColumnIndex("serviceId")));
model.setServiceNo(cursor.getString(cursor.getColumnIndex("serviceNo")));
model.setServiceName(cursor.getString(cursor.getColumnIndex("serviceName"))); model.setServiceName(cursor.getString(cursor.getColumnIndex("serviceName")));
model.setServiceLanguage(cursor.getString(cursor.getColumnIndex("serviceLanguage"))); model.setServiceLanguage(cursor.getString(cursor.getColumnIndex("serviceLanguage")));
model.setNewBossSwitch(cursor.getInt(cursor.getColumnIndex("newBossSwitch"))); model.setNewBossSwitch(cursor.getInt(cursor.getColumnIndex("newBossSwitch")));
...@@ -137,7 +136,6 @@ public class ServiceInfoManager extends SobotCommonDao<SobotServiceInfoModel> { ...@@ -137,7 +136,6 @@ public class ServiceInfoManager extends SobotCommonDao<SobotServiceInfoModel> {
contentValues.put("robotVersion", infoModel.getRobotVersion()); contentValues.put("robotVersion", infoModel.getRobotVersion());
contentValues.put("onlineVersion", infoModel.getOnlineVersion()); contentValues.put("onlineVersion", infoModel.getOnlineVersion());
contentValues.put("companyId", infoModel.getCompanyId()); contentValues.put("companyId", infoModel.getCompanyId());
contentValues.put("local_language", infoModel.getLanguage());
contentValues.put(SobotServiceInfoModel.ACCESS_TOKEN, infoModel.getAccess_token()); contentValues.put(SobotServiceInfoModel.ACCESS_TOKEN, infoModel.getAccess_token());
contentValues.put(SobotServiceInfoModel.LOGIN_TIME, infoModel.getLogin_time()); contentValues.put(SobotServiceInfoModel.LOGIN_TIME, infoModel.getLogin_time());
contentValues.put("login_account", infoModel.getLoginAccount()); contentValues.put("login_account", infoModel.getLoginAccount());
...@@ -145,6 +143,7 @@ public class ServiceInfoManager extends SobotCommonDao<SobotServiceInfoModel> { ...@@ -145,6 +143,7 @@ public class ServiceInfoManager extends SobotCommonDao<SobotServiceInfoModel> {
contentValues.put("wslinkDefault", infoModel.getWslinkDefault()); contentValues.put("wslinkDefault", infoModel.getWslinkDefault());
contentValues.put("serviceId", infoModel.getServiceId()); contentValues.put("serviceId", infoModel.getServiceId());
contentValues.put("serviceNo", infoModel.getServiceNo());
contentValues.put("serviceName", infoModel.getServiceName()); contentValues.put("serviceName", infoModel.getServiceName());
contentValues.put("serviceLanguage", infoModel.getServiceLanguage()); contentValues.put("serviceLanguage", infoModel.getServiceLanguage());
contentValues.put("newBossSwitch", infoModel.getNewBossSwitch()); contentValues.put("newBossSwitch", infoModel.getNewBossSwitch());
......
...@@ -190,8 +190,8 @@ class SobotCommonDBHelper extends SQLiteOpenHelper { ...@@ -190,8 +190,8 @@ class SobotCommonDBHelper extends SQLiteOpenHelper {
"kbVersion INTEGER , " + "kbVersion INTEGER , " +
"robotVersion INTEGER , " + "robotVersion INTEGER , " +
"onlineVersion INTEGER , " + "onlineVersion INTEGER , " +
"local_language VARCHAR(10) , " +
"serviceId VARCHAR(40)," + "serviceId VARCHAR(40)," +
"serviceNo VARCHAR(60)," +
"serviceName VARCHAR(600)," + "serviceName VARCHAR(600)," +
"newBossSwitch INTEGER," + "newBossSwitch INTEGER," +
"region INTEGER," + "region INTEGER," +
......
...@@ -17,6 +17,11 @@ public class SobotServiceInfoModel implements Serializable { ...@@ -17,6 +17,11 @@ public class SobotServiceInfoModel implements Serializable {
*/ */
private String serviceId; private String serviceId;
/** /**
* 客服工号
*/
private String serviceNo;
/**
* 客服名字 * 客服名字
*/ */
private String serviceName; private String serviceName;
...@@ -52,11 +57,6 @@ public class SobotServiceInfoModel implements Serializable { ...@@ -52,11 +57,6 @@ public class SobotServiceInfoModel implements Serializable {
private int callV6Flag; private int callV6Flag;
/** /**
* 语言
*/
private String language;
/**
* 时区 * 时区
*/ */
private String timezone; private String timezone;
...@@ -380,6 +380,14 @@ public class SobotServiceInfoModel implements Serializable { ...@@ -380,6 +380,14 @@ public class SobotServiceInfoModel implements Serializable {
this.serviceId = serviceId; this.serviceId = serviceId;
} }
public String getServiceNo() {
return serviceNo;
}
public void setServiceNo(String serviceNo) {
this.serviceNo = serviceNo;
}
public List<ServiceFunctionVoModel> getFunctionStr() { public List<ServiceFunctionVoModel> getFunctionStr() {
return functionStr; return functionStr;
} }
...@@ -420,14 +428,6 @@ public class SobotServiceInfoModel implements Serializable { ...@@ -420,14 +428,6 @@ public class SobotServiceInfoModel implements Serializable {
this.region = region; this.region = region;
} }
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
public String getTimezone() { public String getTimezone() {
return timezone; return timezone;
} }
......
...@@ -339,9 +339,10 @@ public class SobotPermissionManager { ...@@ -339,9 +339,10 @@ public class SobotPermissionManager {
SobotServiceInfoModel serviceInfoModel = SobotLoginTools.getInstance().getServiceInfo(); SobotServiceInfoModel serviceInfoModel = SobotLoginTools.getInstance().getServiceInfo();
if (serviceInfoModel != null) { if (serviceInfoModel != null) {
if (serviceInfoModel.getNewBossSwitch() > 0) { if (serviceInfoModel.getNewBossSwitch() > 0) {
if (!TextUtils.isEmpty(type) && serviceInfoModel != null && serviceInfoModel.getFunctionStr() != null) { List<ServiceFunctionVoModel> functionVoModelList = FunctionManager.getInstance().getFunctionVos();
for (int i = 0; i < serviceInfoModel.getFunctionStr().size(); i++) { if (!TextUtils.isEmpty(type) && functionVoModelList != null ) {
ServiceFunctionVoModel cusFunctionVoModel = serviceInfoModel.getFunctionStr().get(i); for (int i = 0; i < functionVoModelList.size(); i++) {
ServiceFunctionVoModel cusFunctionVoModel = functionVoModelList.get(i);
if (getCodeByType(type).equals(cusFunctionVoModel.getCode())) { if (getCodeByType(type).equals(cusFunctionVoModel.getCode())) {
return true; return true;
} }
...@@ -367,9 +368,10 @@ public class SobotPermissionManager { ...@@ -367,9 +368,10 @@ public class SobotPermissionManager {
SobotServiceInfoModel serviceInfoModel = SobotLoginTools.getInstance().getServiceInfo(); SobotServiceInfoModel serviceInfoModel = SobotLoginTools.getInstance().getServiceInfo();
if (serviceInfoModel != null) { if (serviceInfoModel != null) {
if (serviceInfoModel.getNewBossSwitch() > 0) { if (serviceInfoModel.getNewBossSwitch() > 0) {
if (!TextUtils.isEmpty(type) && serviceInfoModel != null && serviceInfoModel.getFunctionStr() != null) { List<ServiceFunctionVoModel> functionVoModelList = FunctionManager.getInstance().getFunctionVos();
for (int i = 0; i < serviceInfoModel.getFunctionStr().size(); i++) { if (!TextUtils.isEmpty(type) && functionVoModelList != null) {
ServiceFunctionVoModel cusFunctionVoModel = serviceInfoModel.getFunctionStr().get(i); for (int i = 0; i < functionVoModelList.size(); i++) {
ServiceFunctionVoModel cusFunctionVoModel = functionVoModelList.get(i);
if (type.equals(cusFunctionVoModel.getCode())) { if (type.equals(cusFunctionVoModel.getCode())) {
return true; return true;
} }
......
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