feat: 升级权限管理模式

This commit is contained in:
augushong
2025-03-20 16:57:05 +08:00
parent 1887733b32
commit d3e85fa552
50 changed files with 330 additions and 1125 deletions

View File

@@ -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);