Browse Source

Ignore unimportant Exception

兔姬桑 4 years ago
parent
commit
fb1bee8039

+ 4 - 1
app/Exceptions/Handler.php

@@ -12,6 +12,7 @@ use Illuminate\Session\TokenMismatchException;
 use Log;
 use ReflectionException;
 use Response;
+use Symfony\Component\HttpKernel\Exception\HttpException;
 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 use Throwable;
 
@@ -22,7 +23,9 @@ class Handler extends ExceptionHandler
      *
      * @var array
      */
-    protected $dontReport = [];
+    protected $dontReport = [
+        HttpException::class,
+    ];
 
     /**
      * A list of the inputs that are never flashed for validation exceptions.

+ 1 - 1
app/Http/Controllers/AuthController.php

@@ -360,7 +360,7 @@ class AuthController extends Controller
     //邮箱检查
     private function emailChecker($email, $returnType = 0)
     {
-        $emailFilterList = $this->emailFilterList(sysConfig('is_email_filtering'));
+        $emailFilterList = EmailFilter::whereType(sysConfig('is_email_filtering'))->pluck('words')->toArray();
         $emailSuffix = explode('@', $email); // 提取邮箱后缀
         switch (sysConfig('is_email_filtering')) {
             // 黑名单

+ 0 - 6
app/Http/Controllers/Controller.php

@@ -78,12 +78,6 @@ class Controller extends BaseController
         return $i;
     }
 
-    // 获取邮箱后缀
-    public function emailFilterList($type): array
-    {
-        return EmailFilter::whereType($type)->pluck('words')->toArray();
-    }
-
     // 将Base64图片转换为本地图片并保存
     public function base64ImageSaver($base64_image_content): ?string
     {