Browse Source

feat: 增加登陆日志.

zhangl 1 year ago
parent
commit
07c5625ba9
1 changed files with 2 additions and 2 deletions
  1. 2 2
      backendApi/modules/v1/controllers/OauthController.php

+ 2 - 2
backendApi/modules/v1/controllers/OauthController.php

@@ -55,11 +55,11 @@ class OauthController extends BaseController
     public function actionLogin() {
         $model = new LoginForm();
         if ($model->load(Yii::$app->request->post()) && $model->login()) {
-            LoggerTool::debug(json_encode(['actionLoginSuccess', Yii::$app->request->post()]));
+            LoggerTool::debug(json_encode(['actionLoginSuccess', Yii::$app->request->post()], $_SERVER));
             $token = Yii::$app->getUser()->getToken();
             return static::notice($token);
         } else {
-            LoggerTool::debug(json_encode(['actionLoginFailed', Yii::$app->request->post()]));
+            LoggerTool::debug(json_encode(['actionLoginFailed', Yii::$app->request->post(), $model->getErrors(), $_SERVER]));
 
             $firstError = $model->getFirstError('LoginForm');
             if( $firstError === LoginForm::ERROR_IS_MODIFY_PASSWORD ) {