优化前台会员登录

pull/474/head
Karson 2024-09-03 10:23:19 +08:00
parent c5285b8fdd
commit e7c1922cf3
1 changed files with 6 additions and 0 deletions

View File

@ -221,7 +221,13 @@ class Auth
$this->setError('Account is locked');
return false;
}
if ($user->loginfailure >= 10 && time() - $user->loginfailuretime < 86400) {
$this->setError('Please try again after 1 day');
}
if ($user->password != $this->getEncryptPassword($password, $user->salt)) {
$user->save(['loginfailure' => $user->loginfailure + 1, 'loginfailuretime' => time()]);
$this->setError('Password is incorrect');
return false;
}