@InjectHttpErr(value = {1, 3})
 public void resultErr(ResponseEntity r) {
   dismissDialog();
   Ioc.getIoc().getLogger().i("接口请求异常:" + r.getContentAsString());
   if (r.getKey() == 1) {
     pageUtil.isEndDownPage();
     Toast.makeText(activity, ErrorMsgEnum.NET_ERROR.getName(), Toast.LENGTH_SHORT).show();
   }
 }
Beispiel #2
0
  /** 自动验证成功的方法 */
  @Override
  public void onValidationSucceeded() {
    showDialog("登录中...");
    Ioc.getIoc().getLogger().i("登录前端验证成功");
    // Toast.makeText(this, "前端验证通过", Toast.LENGTH_SHORT).show();

    loginMap = new HashMap<String, String>();
    loginMap.put("account", login_name.getText().toString().trim());
    loginMap.put("password", login_pwd.getText().toString().trim());

    // 验证手机是否联网
    if (!Handler_Network.isNetworkAvailable(this)) {
      Toast.makeText(this, ErrorMsgEnum.NET_ERROR.getName(), Toast.LENGTH_SHORT).show();
      return;
    }
    config = new InternetConfig();
    config.setKey(R.raw.client);
    config.setHead(CommonUtils.inHeaders());
    Ioc.getIoc().getLogger().i("调用后台登录接口:[" + Url.METHOD_LOGIN + "]");
    // 调用后台登录接口
    FastHttpHander.ajaxString(Url.METHOD_LOGIN, Handler_Json.beanToJson(loginMap), config, this);
  }
Beispiel #3
0
 @InjectHttpErr
 public void fail(ResponseEntity entity) {
   dismissDialog();
   Ioc.getIoc().getLogger().i("登录失败,请检查网络");
   Toast.makeText(this, ErrorMsgEnum.NET_ERROR.getName(), Toast.LENGTH_SHORT).show();
 }