update app/admin/library/Auth.php.
异常会导致其他查询接口报错 Signed-off-by: 胡图图 <209766828@qq.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user