1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-08-11 00:41:39 +08:00

修正帐号锁定后还能登录的问题

This commit is contained in:
koogua 2022-07-15 17:35:22 +08:00
parent 175737f274
commit f5719c2ee7

View File

@ -177,10 +177,10 @@ class Account extends Validator
public function checkIfAllowLogin(UserModel $user) public function checkIfAllowLogin(UserModel $user)
{ {
$locked = $user->locked == 1; $case1 = $user->locked == 1;
$expired = $user->lock_expiry_time > time(); $case2 = $user->lock_expiry_time > time();
if ($locked && !$expired) { if ($case1 && $case2) {
throw new ForbiddenException('account.locked'); throw new ForbiddenException('account.locked');
} }