mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-06 18:12:50 +08:00
feat: 升级权限管理模式
This commit is contained in:
@@ -87,7 +87,7 @@ class NodeBase
|
||||
$actionList[] = [
|
||||
'node' => $controllerFormat . '/' . $method_name,
|
||||
'title' => $actionTitle,
|
||||
'is_auth' => $actionAuth,
|
||||
'auth' => $actionAuth,
|
||||
'type' => 2,
|
||||
];
|
||||
}
|
||||
@@ -100,7 +100,7 @@ class NodeBase
|
||||
$actionList[] = [
|
||||
'node' => $controllerFormat . '/' . $nodeAnnotation->name,
|
||||
'title' => $nodeAnnotation->title,
|
||||
'is_auth' => $nodeAnnotation->auth,
|
||||
'auth' => $nodeAnnotation->auth,
|
||||
'type' => 2,
|
||||
];
|
||||
}
|
||||
@@ -110,12 +110,16 @@ class NodeBase
|
||||
if (!empty($actionList)) {
|
||||
// 读取Controller的注解
|
||||
$controllerAnnotation = $reader->getClassAnnotation($reflectionClass, ControllerAnnotation::class);
|
||||
$controllerTitle = !empty($controllerAnnotation) && !empty($controllerAnnotation->title) ? $controllerAnnotation->title : null;
|
||||
$controllerAuth = !empty($controllerAnnotation) && !empty($controllerAnnotation->auth) ? $controllerAnnotation->auth : false;
|
||||
$controllerTitle = null;
|
||||
$controllerModule = '通用';
|
||||
if(!empty($controllerAnnotation)){
|
||||
$controllerTitle = $controllerAnnotation->title;
|
||||
$controllerModule = $controllerAnnotation->module;
|
||||
}
|
||||
$nodeList[] = [
|
||||
'node' => $controllerFormat,
|
||||
'title' => $controllerTitle,
|
||||
'is_auth' => $controllerAuth,
|
||||
'module' => $controllerModule,
|
||||
'type' => 1,
|
||||
];
|
||||
$nodeList = array_merge($nodeList, $actionList);
|
||||
|
||||
Reference in New Issue
Block a user