From d1bd17a26c574caba254995b7d76892de35231cc Mon Sep 17 00:00:00 2001 From: sa0ChunLuyu Date: Fri, 27 Oct 2023 10:41:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=20BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/Libraries/Login.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/app/Libraries/Login.php b/api/app/Libraries/Login.php index 0546e56..4da002a 100755 --- a/api/app/Libraries/Login.php +++ b/api/app/Libraries/Login.php @@ -18,17 +18,17 @@ class Login $auth = AdminAuth::where('id', $auth)->where('status', 1)->where('del', 2)->first(); if (!$auth) return ['code' => 100004, 'message' => '权限不足']; if (self::$info->admin_auth_group === 0) { - if ($auth->check !== 1) return ['code' => 100004, 'message' => '权限不足']; + if ($auth->check !== 2) return ['code' => 100004, 'message' => '权限不足']; } else { - if ($auth->check === 1) return ['code' => 0]; - $admin_auth = AdminAuthGroup::select('id') + if ($auth->check === 2) return ['code' => 0]; + $admin_auth = AdminAuthGroup::select('id', 'status', 'admin_auths') ->where('id', self::$info->admin_auth_group) ->where('del', 2) ->first(); if (!$admin_auth) return ['code' => 100004, 'message' => '权限不足']; if ($admin_auth->status != 1) return ['code' => 100004, 'message' => !!$admin_auth->message ? $admin_auth->message : '权限不足']; - $admin_auths = json_decode($admin_auth, true); - if (!in_array((string)$auth, $admin_auths)) return ['code' => 100004, 'message' => !!$admin_auth->message ? $admin_auth->message : '权限不足']; + $admin_auths = json_decode($admin_auth->admin_auths, true); + if (!in_array((string)$auth->id, $admin_auths)) return ['code' => 100004, 'message' => !!$admin_auth->message ? $admin_auth->message : '权限不足']; } return ['code' => 0]; }