From 07442c8292a1cc50a79bde9382fc163c050f72a8 Mon Sep 17 00:00:00 2001 From: yanwenwu Date: Sat, 25 Jan 2020 11:20:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- catch/permissions/PermissionsMiddleware.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/catch/permissions/PermissionsMiddleware.php b/catch/permissions/PermissionsMiddleware.php index 230dbdf..5a32889 100644 --- a/catch/permissions/PermissionsMiddleware.php +++ b/catch/permissions/PermissionsMiddleware.php @@ -24,10 +24,6 @@ class PermissionsMiddleware */ public function handle(Request $request, \Closure $next) { - // 超级管理员 - if ($request->user()->id === config('catch.permissions.super_admin_id')) { - return $next($request); - } // Get 请求 if ($request->isGet() && config('catch.permissions.is_allow_get')) { return $next($request); @@ -49,7 +45,10 @@ class PermissionsMiddleware if (!$user) { throw new PermissionForbiddenException('Login is invalid', Code::LOST_LOGIN); } - + // 超级管理员 + if ($request->user()->id === config('catch.permissions.super_admin_id')) { + return $next($request); + } // toad $permission = $this->getPermission($module, $controller, $action); if (!$permission || !in_array($permission->id, Cache::get(CatchCacheKeys::USER_PERMISSIONS . $user->id))) {