|
|
@@ -214,6 +214,7 @@ public class ViewUtil {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @Deprecated
|
|
|
public static void startNetThread(final String url,
|
|
|
final Map<String, String> params, final Handler handler,
|
|
|
final int what, final Message message, final Bundle bundle,
|
|
|
@@ -354,6 +355,7 @@ public class ViewUtil {
|
|
|
break;
|
|
|
case Constants.SUCCESS_ERP://切换公司成功
|
|
|
String result = msg.getData().getString("result");
|
|
|
+ Log.i("Arison", "" + result);
|
|
|
boolean success = JSON.parseObject(result).getBoolean("success");
|
|
|
if (success) {
|
|
|
Intent intent = new Intent("com.app.home.update");
|
|
|
@@ -374,6 +376,9 @@ public class ViewUtil {
|
|
|
}
|
|
|
ToastMessage(MyApplication.getInstance(), "服务器拒绝访问!");
|
|
|
break;
|
|
|
+ case Constants.APP_SOCKETIMEOUTEXCEPTION:
|
|
|
+ ToastMessage(MyApplication.getInstance(), "服务器拒绝此账套登录!");
|
|
|
+ break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
@@ -800,11 +805,12 @@ public class ViewUtil {
|
|
|
String master = CommonUtil.getSharedPreferences(ct, "erp_master");
|
|
|
String phone = CommonUtil.getSharedPreferences(ct, "user_phone");
|
|
|
String password = CommonUtil.getSharedPreferences(ct, "user_password");
|
|
|
- Map<String, String> params = new HashMap<String, String>();
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
params.put("username", phone);
|
|
|
params.put("password", password);
|
|
|
params.put("master", master);
|
|
|
- startNetThread(url, params, handler, what, null, null, "post");
|
|
|
+ httpSendRequest(ct, url, params, handler, null, what, null, null, "post");
|
|
|
+ //startNetThread(url, params, handler, what, null, null, "post");
|
|
|
}
|
|
|
|
|
|
// 登录ERP
|
|
|
@@ -812,12 +818,12 @@ public class ViewUtil {
|
|
|
String password) {
|
|
|
mdProcessDialog.setContent("正在验证ERP...");
|
|
|
url = url + "mobile/login.action";
|
|
|
- Map<String, String> params = new HashMap<String, String>();
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
params.put("username", username);
|
|
|
params.put("password", password);
|
|
|
params.put("master", master);
|
|
|
- startNetThread(url, params, handler, Constants.SUCCESS_ERP, null, null,
|
|
|
- "post");
|
|
|
+
|
|
|
+ httpSendRequest(ct, url, params, handler, null, Constants.SUCCESS_ERP, null, null, "post");
|
|
|
}
|
|
|
|
|
|
|