Browse Source

登录超过五次,限制一分钟内不可以在登陆2

master
wanghongjun 2 weeks ago
parent
commit
def460c96f
  1. 5
      app/Http/Controllers/Admin/AuthController.php

5
app/Http/Controllers/Admin/AuthController.php

@ -123,9 +123,12 @@ class AuthController extends Controller
],
'token' => $token,
]);
} catch (ValidationException|CustomException $e) {
} catch (ValidationException $e) {
RateLimiter::hit($throttleKey, $this->decayMinutes());
throw $e;
} catch (CustomException $e) {
RateLimiter::hit($throttleKey, $this->decayMinutes());
return $this->responseService->businessError($e->getMessage(), $e->getCode());
} catch (\Exception $e) {
RateLimiter::hit($throttleKey, $this->decayMinutes());
$m_prefix = __('admin.login') . __('admin.failed');

Loading…
Cancel
Save