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