Ejemplo n.º 1
0
 /**
  * 用户忘记密码后重置密码行为
  * @return array|string
  */
 public function actionResetpassword()
 {
     $result = App::AppGet();
     try {
         if ($result['errorNum']) {
             $result = array('errorNum' => $result['errorNum'], 'errorMsg' => $result['errorMsg'], 'data' => null);
         } else {
             $data = $result['data'];
             if (array_key_exists('phone', $data) && array_key_exists('new_pwd', $data) && array_key_exists('rep_pwd', $data) && array_key_exists('phone_code', $data) && array_key_exists('name', $data) && array_key_exists('idcard', $data)) {
                 $phone = $data['phone'];
                 $new_pwd = $data['new_pwd'];
                 $rep_pwd = $data['rep_pwd'];
                 $phone_code = $data['phone_code'];
                 $name = $data['name'];
                 $idcard = $data['idcard'];
                 $result = member::resetPassword($phone, $new_pwd, $rep_pwd, $phone_code, $name, $idcard);
             } else {
                 $result = array('errorNum' => '1', 'errorMsg' => '参数错误', 'data' => null);
             }
         }
     } catch (ErrorException $e) {
         Yii::error("用户忘记密码后重置密码行为异常 方法:actionResetpassword 参数:" . json_encode($result['data']), "app");
         Yii::trace($e->getMessage(), "app");
         $result = array('errorNum' => '7', 'errorMsg' => '服务器异常,请联系管理员', 'data' => null);
     }
     $result = App::AppReturn($result);
     return $result;
 }