diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index 3709f22..f300b23 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -33,12 +33,16 @@ class AuthController extends Controller $user = AdminUser::where(['username' => $username])->first(); - if ($user?->banned_at) { - return $this->error('账号已封禁,请联系管理员'); - } - $cacheKey = "admin_user_ban:{$username}"; + if ($user?->banned_at) { + if ($user->banned_at->addMinutes(5)->gte(now())) { + return $this->error('账号已封禁,请联系管理员'); + } + + $this->cache->forget($cacheKey); + } + if (! Hash::check($request->input('password'), (string) $user?->password)) { $this->cache->add($cacheKey, 0, 86400);