Преглед изворни кода

Merge branch 'feature/ip_check_new_limit' into feature/NC-45

jerry пре 1 година
родитељ
комит
00f7214ddd
1 измењених фајлова са 3 додато и 8 уклоњено
  1. 3 8
      frontendApi/modules/v1/models/LoginForm.php

+ 3 - 8
frontendApi/modules/v1/models/LoginForm.php

@@ -123,7 +123,10 @@ class LoginForm extends Model
 
         $result = false;
         try{
+            // 验证IP
+            (new IpFilter())->frontApiCheck(true);
             $this->getUser();
+
             if(!$this->_user){
                 throw new Exception('账号不存在');
             }
@@ -185,19 +188,11 @@ class LoginForm extends Model
             $result = Yii::$app->user->loginWithUAndP($this->_user);
 
         }catch(\Exception $e){
-
             $transaction->rollBack();
             $this->setError($e->getMessage());
             //AdminLoginLogger::fail($this->_user, $e->getMessage());
         }
 
-        try{
-            (new IpFilter())->frontApiCheck(true);
-        } catch(\Exception $exception){
-            $this->clearErrors();
-            $this->setError($exception->getMessage());
-        }
-
         return $result;
     }