private void authenticate() { String name = et_name.getText().toString().trim(); String id = et_id.getText().toString().trim(); //只允許輸入二代身份證:18位,最後一位可能是字母的,也可能是數字.但二代身份證必須是18位 if (TextUtils.isEmpty(name) || !MShareUtil.isIDLegal(id)) { ToastUtil.toast("請檢查輸入是否合法呀"); return; } /* LoginResultBean currentProcessingUser = UserDao.getDaoInstance(this).queryCurrentProcessingUser(); int verificationState = currentProcessingUser.getCertificationStatus(); if(verificationState==1) ToastUtil.toast_debug("verification_state is true.*_*"); else ToastUtil.toast_debug("verification_state is false.*<>*"); //判斷是否開啓押金頁面,兩條路:1.主頁 2.押金頁 Intent intent=new Intent(); if (currentProcessingUser.getOpenDesposit() == 1 && currentProcessingUser.getDespositStatus() == 1) {//如果開啓押金頁面 intent.setClass(this,DepositActivity.class); } else { intent.setClass(this, MainActivity.class); } startActivity(intent); overridePendingTransition(R.anim.global_in, 0); finish();*/ if (httpUtil == null) httpUtil = new HttpUtil(); UserDao userDao = UserDao.getDaoInstance(this); LoginResultBean currentUser = userDao.queryCurrentProcessingUser(); String phoneNumber = currentUser.getPhoneNumber(); String[] params = new String[]{Constants.AppID, GlobalConfig.AppID,Constants.ECID, GlobalConfig.ECID, Constants.PhoneNumber, phoneNumber, Constants.RealName, name, Constants.ID, id, Constants.AppType, GlobalConfig.AppType}; httpUtil.callJson(handler, this, GlobalConfig.MSHARE_SERVER_ROOT + GlobalConfig.MSHARE_VERIFY_NUMBER_OF_ID_CARD, BaseResultBean.class, params); } @Override protected void getMessage(Message msg) { BaseResultBean result = (BaseResultBean) msg.obj; if (result != null && result.getResult()) { boolean update_result = UserDao.getDaoInstance(this).updateVerificationState(); ToastUtil.toast_debug("驗證成功" + (update_result ?"true":"false")); LoginResultBean currentProcessingUser = UserDao.getDaoInstance(this).queryCurrentProcessingUser(); int verificationState = currentProcessingUser.getCertificationStatus(); if(verificationState==1) ToastUtil.toast_debug("verification_state is true.*_*"); else ToastUtil.toast_debug("verification_state is false.*<>*"); //判斷是否開啓押金頁面,兩條路:1.主頁 2.押金頁 Intent intent=new Intent(); if (currentProcessingUser.getOpenDesposit() == 1 && currentProcessingUser.getDespositStatus() == 1) {//如果開啓押金頁面 intent.setClass(this,DepositActivity.class); } else { intent.setClass(this, MainActivity.class); } startActivity(intent); overridePendingTransition(R.anim.global_in, 0); finish(); } else { ToastUtil.toast("驗證失敗,請重新驗證"); } }
關於接口 實名認證
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.