Kernel.php 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. namespace App\Http;
  3. use Illuminate\Foundation\Http\Kernel as HttpKernel;
  4. class Kernel extends HttpKernel
  5. {
  6. /**
  7. * The application's global HTTP middleware stack.
  8. *
  9. * These middleware are run during every request to your application.
  10. *
  11. * @var array
  12. */
  13. protected $middleware = [
  14. \App\Http\Middleware\CheckForMaintenanceMode::class,
  15. \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
  16. \App\Http\Middleware\TrimStrings::class,
  17. \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
  18. \App\Http\Middleware\TrustProxies::class,
  19. \Barryvdh\Cors\HandleCors::class,
  20. ];
  21. /**
  22. * The application's route middleware groups.
  23. *
  24. * @var array
  25. */
  26. protected $middlewareGroups = [
  27. 'web' => [
  28. \App\Http\Middleware\EncryptCookies::class,
  29. \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
  30. \Illuminate\Session\Middleware\StartSession::class,
  31. // \Illuminate\Session\Middleware\AuthenticateSession::class,
  32. \Illuminate\View\Middleware\ShareErrorsFromSession::class,
  33. \App\Http\Middleware\VerifyCsrfToken::class,
  34. \Illuminate\Routing\Middleware\SubstituteBindings::class,
  35. ],
  36. 'api' => [
  37. // 'throttle:60,1',//限流
  38. 'bindings',
  39. \Barryvdh\Cors\HandleCors::class,
  40. 'force-json',
  41. ],
  42. 'admin' => [
  43. 'force-json',
  44. 'bindings',
  45. ],
  46. ];
  47. /**
  48. * The application's route middleware.
  49. *
  50. * These middleware may be assigned to groups or used individually.
  51. *
  52. * @var array
  53. */
  54. protected $routeMiddleware = [
  55. 'auth' => \App\Http\Middleware\Authenticate::class,
  56. 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
  57. 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
  58. 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
  59. 'can' => \Illuminate\Auth\Middleware\Authorize::class,
  60. 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
  61. 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
  62. 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
  63. 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
  64. 'force-json' => \App\Http\Middleware\ForceJson::class,
  65. 'admin.permission' => \App\Contracts\PermissionMiddleware::class,
  66. 'openToken' => \App\Http\Middleware\CheckOpenToken::class,
  67. 'singleLoginApi' => \App\Http\Middleware\SingleLoginLimit::class,
  68. 'limitAdminLoginApp' => \App\Http\Middleware\LimitAdminLoginApp::class,
  69. 'detection_of_merchant_status' => \App\Http\Middleware\MerchantMiddleware::class, // 检测商户状态
  70. ];
  71. /**
  72. * The priority-sorted list of middleware.
  73. *
  74. * This forces non-global middleware to always be in the given order.
  75. *
  76. * @var array
  77. */
  78. protected $middlewarePriority = [
  79. \Illuminate\Session\Middleware\StartSession::class,
  80. \Illuminate\View\Middleware\ShareErrorsFromSession::class,
  81. \App\Http\Middleware\ForceJson::class,
  82. \App\Http\Middleware\Authenticate::class,
  83. \Illuminate\Session\Middleware\AuthenticateSession::class,
  84. \Illuminate\Routing\Middleware\SubstituteBindings::class,
  85. \Illuminate\Auth\Middleware\Authorize::class,
  86. ];
  87. }