Jelajahi Sumber

修复关闭debug模式后访问无权限页面会显示异常报文问题

Jiang qinghua 3 tahun lalu
induk
melakukan
a5e0936c2d
1 mengubah file dengan 5 tambahan dan 0 penghapusan
  1. 5 0
      src/Exception/Handler.php

+ 5 - 0
src/Exception/Handler.php

@@ -4,6 +4,7 @@ namespace Dcat\Admin\Exception;
 
 use Dcat\Admin\Contracts\ExceptionHandler;
 use Dcat\Admin\Support\Helper;
+use Illuminate\Http\Exceptions\HttpResponseException;
 use Illuminate\Support\MessageBag;
 use Illuminate\Support\ViewErrorBag;
 
@@ -18,6 +19,10 @@ class Handler implements ExceptionHandler
      */
     public function handle(\Throwable $e)
     {
+        if ($e instanceof HttpResponseException) {
+            throw $e;
+        }
+
         $this->report($e);
 
         return $this->render($e);