/** * 验证密码 * * @return array */ public function actionVerifyPassword() { $model = new VerifyPasswordForm(); if ($model->load(Yii::$app->request->post(), '') && $model->validate()) { return ['status' => 'success', 'data' => []]; } else { return ['status' => 'fail', 'data' => ['errors' => $model->getErrors('password')]]; } }