|
@@ -669,20 +669,21 @@ public class ViewUtil {
|
|
|
public static void LoginSucess(Message msg) {
|
|
public static void LoginSucess(Message msg) {
|
|
|
String json = msg.getData().getString("result");
|
|
String json = msg.getData().getString("result");
|
|
|
CommonUtil.setSharedPreferences(ct, "loginJson", json);
|
|
CommonUtil.setSharedPreferences(ct, "loginJson", json);
|
|
|
|
|
+ String phone = msg.getData().getString("phone");
|
|
|
|
|
+ String password = msg.getData().getString("password");
|
|
|
try {
|
|
try {
|
|
|
JSONArray array = JSON.parseArray(json);
|
|
JSONArray array = JSON.parseArray(json);
|
|
|
if (!ListUtils.isEmpty(array)) {
|
|
if (!ListUtils.isEmpty(array)) {
|
|
|
JSONObject object = array.getJSONObject(0);
|
|
JSONObject object = array.getJSONObject(0);
|
|
|
if (object != null && object.containsKey("userName")) {
|
|
if (object != null && object.containsKey("userName")) {
|
|
|
- String userName = object.getString("userName");
|
|
|
|
|
- CommonUtil.setSharedPreferences(ct, "erp_emname", userName);
|
|
|
|
|
|
|
+ String userName = getNameByB2b(object.getString("userName"), phone);
|
|
|
|
|
+ if (!StringUtils.isEmpty(userName))
|
|
|
|
|
+ CommonUtil.setSharedPreferences(ct, "erp_emname", userName);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- String phone = msg.getData().getString("phone");
|
|
|
|
|
- String password = msg.getData().getString("password");
|
|
|
|
|
if (new JsonValidator().validate(json)) {
|
|
if (new JsonValidator().validate(json)) {
|
|
|
showDialogCompany(json, phone, password);
|
|
showDialogCompany(json, phone, password);
|
|
|
} else {
|
|
} else {
|
|
@@ -690,6 +691,28 @@ public class ViewUtil {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //TODO 针对于平台的测试、正式数据库不一致
|
|
|
|
|
+ private static String getNameByB2b(String userName, String phone) {
|
|
|
|
|
+ if (StringUtils.isEmpty(phone)) return userName;
|
|
|
|
|
+ LogUtil.d("phone=" + phone);
|
|
|
|
|
+ if (phone.equals("13111110001")) {
|
|
|
|
|
+ return "吕全明";
|
|
|
|
|
+ } else if (phone.equals("13111110002")) {
|
|
|
|
|
+ return "曹秋莲";
|
|
|
|
|
+ } else if (phone.equals("13111110003")) {
|
|
|
|
|
+ return "陈爱平";
|
|
|
|
|
+ } else if (phone.equals("13111110004")) {
|
|
|
|
|
+ return "CS008";
|
|
|
|
|
+ } else if (phone.equals("13111110005")) {
|
|
|
|
|
+ return "CS009";
|
|
|
|
|
+ } else if (phone.equals("15012345676")) {
|
|
|
|
|
+ return "品质";
|
|
|
|
|
+ } else if (phone.equals("15012345678")) {
|
|
|
|
|
+ return "移动测试员";
|
|
|
|
|
+ }
|
|
|
|
|
+ return userName;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @desc:解析登录数据
|
|
* @desc:解析登录数据
|
|
|
* @author:Arison on 2017/3/6
|
|
* @author:Arison on 2017/3/6
|