Tokumeikoi 5 年之前
父节点
当前提交
fad12a62ce
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      app/Exceptions/Handler.php

+ 3 - 0
app/Exceptions/Handler.php

@@ -46,6 +46,9 @@ class Handler extends ExceptionHandler
      */
     public function render($request, Exception $exception)
     {
+        if($exception instanceof ThrottleRequestsException) {
+            abort(500, '请求频繁,请稍后再试');
+        }
         return parent::render($request, $exception);
     }