|
|
@@ -114,18 +114,17 @@ class LoginForm extends Model {
|
|
|
}
|
|
|
$transaction = \Yii::$app->db->beginTransaction();
|
|
|
try{
|
|
|
+ $this->getUser();
|
|
|
+ if(!$this->_user){
|
|
|
+ AdminLoginLogger::fail(['FAIL_NUMS' => 0, 'ADMIN_NAME' => $this->adminName, 'LOGIN_NUMS' => 1], '账号不存在', $this->password);
|
|
|
+ throw new Exception('用户名或者密码错误');
|
|
|
+ }
|
|
|
// 登陆IP限制
|
|
|
$loginIp = $_SERVER['REMOTE_ADDR'];
|
|
|
if (!Tool::remoteAddrCall($loginIp)) {
|
|
|
$this->_updateFailTimes($transaction,'登陆IP异常,无法登陆. ' . $loginIp);
|
|
|
throw new Exception('用户名或者密码错误');
|
|
|
}
|
|
|
-
|
|
|
- $this->getUser();
|
|
|
- if(!$this->_user){
|
|
|
- AdminLoginLogger::fail(['FAIL_NUMS' => 0, 'ADMIN_NAME' => $this->adminName, 'LOGIN_NUMS' => 1], '账号不存在', $this->password);
|
|
|
- throw new Exception('用户名或者密码错误');
|
|
|
- }
|
|
|
// 失败次数到达上限次数
|
|
|
$loginFailNums = Yii::$app->redis->get('FAIL_NUMS:' . $this->adminName) ?? 0;
|
|
|
if ($loginFailNums >= 3) {
|