From b0226a38b281ca3d00127b457cf73be141e06bb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=9B=BE=E5=9B=BE?= <209766828@qq.com> Date: Thu, 25 Aug 2022 04:46:13 +0000 Subject: [PATCH] =?UTF-8?q?update=20app/admin/library/Auth.php.=20?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E4=BC=9A=E5=AF=BC=E8=87=B4=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 胡图图 <209766828@qq.com> --- app/admin/library/Auth.php | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/app/admin/library/Auth.php b/app/admin/library/Auth.php index afaf4497..d9cdc443 100644 --- a/app/admin/library/Auth.php +++ b/app/admin/library/Auth.php @@ -293,25 +293,20 @@ class Auth } } else { - if (!Event::hasListener('cmscategoryPermissions')) { - throw new \Exception('请安装CMS插件'); - } else { - - if (!$this->superAdmin()) { - if (!empty($auth_nodes[$class])) { - $list = Event::emit('cmscategoryPermissions', [ - 'field' => $this->authFields, - 'nodes' => $auth_nodes[$class] - ], true); - } - } - - if (empty($list)) { + if (!$this->superAdmin()) { + if (!empty($auth_nodes[$class])) { $list = Event::emit('cmscategoryPermissions', [ - 'field' => $this->authFields + 'field' => $this->authFields, + 'nodes' => $auth_nodes[$class] ], true); } } + + if (empty($list)) { + $list = Event::emit('cmscategoryPermissions', [ + 'field' => $this->authFields + ], true); + } } return $tree ? ($list ? json_encode(list_to_tree($list)) : json_encode([])) : $list; -- Gitee