From 4eaff064116aae62b826ed305cabbba76edcc4d9 Mon Sep 17 00:00:00 2001 From: hnu202326010131 <2950457847@qq.com> Date: Tue, 30 Dec 2025 08:19:14 +0000 Subject: [PATCH] refactor: rename audit logs to operation logs and update related routes and docs --- ....md => 操作日志后端联调指南.md} | 18 ++++++------ frontend-vue/docs/页面功能列表.md | 4 +-- frontend-vue/src/app/components/Sidebar.vue | 4 +-- frontend-vue/src/app/router/index.ts | 2 +- .../{AuditLogs.vue => OperationLogs.vue} | 28 +++++++++---------- 5 files changed, 28 insertions(+), 28 deletions(-) rename frontend-vue/docs/{审计日志后端联调指南.md => 操作日志后端联调指南.md} (79%) rename frontend-vue/src/app/views/{AuditLogs.vue => OperationLogs.vue} (83%) diff --git a/frontend-vue/docs/审计日志后端联调指南.md b/frontend-vue/docs/操作日志后端联调指南.md similarity index 79% rename from frontend-vue/docs/审计日志后端联调指南.md rename to frontend-vue/docs/操作日志后端联调指南.md index b62bb25..75c9294 100644 --- a/frontend-vue/docs/审计日志后端联调指南.md +++ b/frontend-vue/docs/操作日志后端联调指南.md @@ -1,17 +1,17 @@ -# 审计日志后端联调指南 +# 操作日志后端联调指南 -本文档旨在指导后端开发人员如何对接“审计日志”页面的前端接口。 +本文档旨在指导后端开发人员如何对接“操作日志”页面的前端接口。 ## 1. 接口概述 -审计日志页面通过 `GET` 请求从后端获取系统操作日志。该页面仅限 `admin`(管理员)角色访问。 +操作日志页面通过 `GET` 请求从后端获取系统操作日志。该页面仅限 `admin`(管理员)角色访问。 ## 2. 接口定义 -### 获取审计日志列表 +### 获取操作日志列表 - **请求方法**: `GET` -- **请求路径**: `/v1/audit-logs` +- **请求路径**: `/v1/operation-logs` - **鉴权要求**: 需在 Header 中携带 `Authorization: Bearer ` #### 响应格式 (JSON) @@ -22,7 +22,7 @@ { "items": [ { - "id": "audit-12345", + "id": "operation-12345", "timestamp": "2025-11-07T10:20:03Z", "user": "admin", "action": "用户登录", @@ -38,7 +38,7 @@ | 前端展示字段 | 推荐后端字段 | 备用适配字段 | | :--- | :--- | :--- | -| 唯一标识 | `id` | `audit_id` | +| 唯一标识 | `id` | `operation_id` | | 时间戳 | `timestamp` | `created_at`, `time` | | 操作用户 | `user` | `username`, `operator` | | 动作名称 | `action` | `operation` | @@ -53,11 +53,11 @@ ## 4. 示例代码 (Axios 调用) ```typescript -const r = await api.get('/v1/audit-logs', { +const r = await api.get('/v1/operation-logs', { headers: { Authorization: `Bearer ${token}` } }) ``` ## 5. 权限说明 -审计日志属于敏感数据,后端接口**必须**校验 `token` 中的角色信息,确保只有具有管理员权限的用户才能获取数据。 +操作日志属于敏感数据,后端接口**必须**校验 `token` 中的角色信息,确保只有具有管理员权限的用户才能获取数据。 diff --git a/frontend-vue/docs/页面功能列表.md b/frontend-vue/docs/页面功能列表.md index 8055b67..1c36be4 100644 --- a/frontend-vue/docs/页面功能列表.md +++ b/frontend-vue/docs/页面功能列表.md @@ -28,8 +28,8 @@ - **执行日志 (Exec Logs)** - **路径**: `/exec-logs` - **功能**: 专门展示自动化脚本或运维指令的执行历史及详细输出结果。 -- **审计日志 (Audit Logs)** - - **路径**: `/audit-logs` (仅管理员) +- **操作日志 (Operation Logs)** + - **路径**: `/operation-logs` (仅管理员) - **功能**: 记录用户在系统内的所有操作行为,用于安全溯源。 ## 4. 诊断与自动化 diff --git a/frontend-vue/src/app/components/Sidebar.vue b/frontend-vue/src/app/components/Sidebar.vue index e635a03..9a50f62 100644 --- a/frontend-vue/src/app/components/Sidebar.vue +++ b/frontend-vue/src/app/components/Sidebar.vue @@ -119,8 +119,8 @@ diff --git a/frontend-vue/src/app/router/index.ts b/frontend-vue/src/app/router/index.ts index 169c4b4..ccd043c 100644 --- a/frontend-vue/src/app/router/index.ts +++ b/frontend-vue/src/app/router/index.ts @@ -15,7 +15,7 @@ const routes: RouteRecordRaw[] = [ { path: '/profile', name: 'profile', component: () => import('../views/Profile.vue'), meta: { requiresAuth: true, roles: AllRoles } }, { path: '/account', name: 'account', component: () => import('../views/Account.vue'), meta: { requiresAuth: true, roles: AllRoles } }, { path: '/user-management', name: 'user-management', component: () => import('../views/UserManagement.vue'), meta: { requiresAuth: true, roles: [Roles.admin] } }, - { path: '/audit-logs', name: 'audit-logs', component: () => import('../views/AuditLogs.vue'), meta: { requiresAuth: true, roles: [Roles.admin] } } + { path: '/operation-logs', name: 'operation-logs', component: () => import('../views/OperationLogs.vue'), meta: { requiresAuth: true, roles: [Roles.admin] } } ] const router = createRouter({ history: createWebHashHistory(), routes }) diff --git a/frontend-vue/src/app/views/AuditLogs.vue b/frontend-vue/src/app/views/OperationLogs.vue similarity index 83% rename from frontend-vue/src/app/views/AuditLogs.vue rename to frontend-vue/src/app/views/OperationLogs.vue index 1572e29..f919ac0 100644 --- a/frontend-vue/src/app/views/AuditLogs.vue +++ b/frontend-vue/src/app/views/OperationLogs.vue @@ -1,19 +1,19 @@