Example #1
0
 @InjectHttpOk(1)
 public void resultOk(ResponseEntity r) {
   dismissDialog();
   if (ResultParse.isResultOK(r, activity)) {
     ArrayList<HashMap<String, String>> list =
         Handler_Json.jsonToList("list", r.getContentAsString());
     String page = (String) Handler_Json.getValue("pageNo", r.getContentAsString());
     String time = (String) Handler_Json.getValue("sysDateTime", r.getContentAsString());
     MangrovePayApp.msgTime = time;
     MangrovePayApp.app.setData("msgTime", time);
     Ioc.getIoc().getLogger().i("-------------------------");
     Ioc.getIoc().getLogger().i("-------------系统时间:" + MangrovePayApp.msgTime);
     if (!Handler_String.isBlank(page)) {
       pageNo = Integer.valueOf(page) + 1;
     }
     initData(list, page);
   }
 }
Example #2
0
  /**
   * *********************************************** @Title: success @Description: TODO(登录返回)
   *
   * @param entity 设定文件
   * @return void 返回类型
   * @throws
   * @date 2015-1-8 ***********************************************
   */
  @InjectHttpOk
  public void success(ResponseEntity entity) {
    Ioc.getIoc().getLogger().i("登录接口状态返回结果【" + entity.toString() + "】");

    // 获取头部信息
    Map<String, String> map = entity.getHeaders();

    // 登录成功 返回OK
    if (ResultParse.isResultOK(entity, this)) {
      // 获取返回内容 ticket
      String jsonString = entity.getContentAsString();

      Ioc.getIoc().getLogger().i("ticket数据【" + jsonString + "】");

      // 存放ticket
      MapVo.map = Handler_Json.JsonToCollection(jsonString); // 设置ticket
      // TODO
      MangrovePayApp.ticket = (String) MapVo.get("ticket");
      // 存储用户名密码到本地
      MangrovePayApp.app.setData("account", loginMap.get("account"));
      MangrovePayApp.app.setData("password", loginMap.get("password"));
      Ioc.getIoc().getLogger().i("登录成功");

      Intent intent = new Intent();
      intent.setClass(this, MainActivity.class);
      startActivity(intent);
      // startActivity(new Intent().setClass(this, CaptureActivity.class));
      this.finish();
    }
    // 登录失败
    else {
      Ioc.getIoc().getLogger().i("登录失败");
      Toast.makeText(this, "登录失败,请检查用户名密码是否正确", Toast.LENGTH_SHORT).show();
      dismissDialog();
    }
  }