/** **显示重设密码的表单(get),重新设置登陆密码(post). * @return string whether or not the password has been reset successfully */ public function actionResetPassword() { if (Yii::$app->request->isGet) { $csrf = Yii::$app->request->csrfToken; return $this->render('reset-password', ['csrf' => $csrf]); } $model = new ResetPasswordForm(); if ($model->load(Yii::$app->request->post(), '') && $model->reset()) { AjaxResponse::success(); } AjaxResponse::fail(null, $model->errors); }