caihongxingqiu 6 gadi atpakaļ
vecāks
revīzija
ce0cc095a3
2 mainītis faili ar 0 papildinājumiem un 44 dzēšanām
  1. 0 39
      app/Providers/AppServiceProvider.php
  2. 0 5
      bootstrap/app.php

+ 0 - 39
app/Providers/AppServiceProvider.php

@@ -4,8 +4,6 @@ namespace App\Providers;
 
 use Illuminate\Support\Facades\Validator;
 use Illuminate\Support\ServiceProvider;
-use Tymon\JWTAuth\Exceptions\TokenExpiredException;
-use Tymon\JWTAuth\Exceptions\TokenInvalidException;
 
 class AppServiceProvider extends ServiceProvider
 {
@@ -19,42 +17,5 @@ class AppServiceProvider extends ServiceProvider
         Validator::extend('mobile', function ($attribute, $value, $parameters) {
             return preg_match('/^1[3456789]{1}\d{9}$/', $value);
         });
-
-//        app('Dingo\Api\Exception\Handler')->register(function (\Tymon\JWTAuth\Exceptions\JWTException $e) {
-//
-//            if ($e instanceof TokenExpiredException) {
-//
-//                $error = [
-//                    'message' => 'Token Expired',
-//                    'errors' => [
-//                        'token_expired' => 'token_expired'
-//                    ],
-//                    'code' => $e->getStatusCode(),
-//                    'status_code' => $e->getStatusCode(),
-//                ];
-//
-//            } else if ($e instanceof TokenInvalidException) {
-//
-//                $error = [
-//                    'message' => 'Token Invalid',
-//                    'errors' => [
-//                        'token_invalid' => 'token_invalid'
-//                    ],
-//                    'code' => $e->getStatusCode(),
-//                    'status_code' => $e->getStatusCode(),
-//                ];
-//
-//            }
-//
-//            return response()->json($error, $e->getStatusCode());
-//        });
-//
-//        app('Dingo\Api\Exception\Handler')->register(function (\Illuminate\Auth\AuthenticationException $e) {
-//            $error = [
-//                'message' => '请重新登录',
-//                'code' => '1001',
-//            ];
-//            return response()->json($error);
-//        });
     }
 }

+ 0 - 5
bootstrap/app.php

@@ -50,11 +50,6 @@ $app->singleton(
     App\Console\Kernel::class
 );
 
-$app->singleton(
-    \Dingo\Api\Contract\Debug\ExceptionHandler::class,
-    \Dingo\Api\Exception\Handler::class
-
-);
 
 /*
 |--------------------------------------------------------------------------