From c805742767caacd227300b8c6d500bdad15516b0 Mon Sep 17 00:00:00 2001 From: ykxiao Date: Mon, 14 Jul 2025 14:46:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=97=A5=E5=BF=97=E3=80=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/RoleController.php | 6 +++++- config/autoload/op_logs.php | 5 +++++ config/routes.php | 8 ++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/app/Controller/RoleController.php b/app/Controller/RoleController.php index e4aebc1..6a5c27e 100644 --- a/app/Controller/RoleController.php +++ b/app/Controller/RoleController.php @@ -63,6 +63,8 @@ class RoleController extends AbstractController // 添加角色. $this->roleServiceInterface->addRole($data); + $this->opLogs('[添加角色]名称 ' . $params['role_name']); + return $this->apiResponse->success(); } @@ -79,7 +81,9 @@ class RoleController extends AbstractController 'params' => $params ]; - $roleList = $this->roleServiceInterface->roleList($data); + $rpcResult = $this->roleServiceInterface->roleList($data); + + $roleList = $rpcResult['result'] ?? []; return $this->apiResponse->success($roleList); } diff --git a/config/autoload/op_logs.php b/config/autoload/op_logs.php index 763c482..61b307d 100644 --- a/config/autoload/op_logs.php +++ b/config/autoload/op_logs.php @@ -44,4 +44,9 @@ return [ 'action' => 'RoleController@assignRolePermissions', 'name' => '角色授权', ], + [ + 'id' => 7, + 'action' => 'RoleController@addRole', + 'name' => '新增|编辑角色', + ], ]; \ No newline at end of file diff --git a/config/routes.php b/config/routes.php index 3eedad6..bd065ae 100644 --- a/config/routes.php +++ b/config/routes.php @@ -59,7 +59,9 @@ Router::addGroup('/api/v1', function () { Router::post('assign.role.auth', [RoleController::class, 'assignRolePermissions']); # 角色授权 Router::post('role.permission.checked', [RoleController::class, 'roleChecked']); # 角色权限选择列表 - // 部门管理 + /** + * 部门管理 + */ Router::post('dept.add', [DeptController::class, 'addDept']); # 新增部门 Router::post('dept.list', [DeptController::class, 'deptList']); # 部门列表 Router::post('dept.delete', [DeptController::class, 'delDept']); # 删除部门 @@ -67,7 +69,9 @@ Router::addGroup('/api/v1', function () { Router::post('dept.list.active', [DeptController::class, 'deptListActive']); # 部门列表(活动) Router::post('dept.update.status', [DeptController::class, 'updateDeptStatus']); # 部门状态 - // 平台公司管理 + /** + * 平台公司管理 + */ Router::post('company.module.add', [RoleController::class, 'addCompanyModule']); # 公司模块授权 Router::post('company.permission.checked', [RoleController::class, 'companyChecked']); # 公司模块选择列表