Kernel.php 3.4 KB

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