操作审计(Audit Log)

This commit is contained in:
Cheng Zhou
2025-12-17 21:19:05 +08:00
parent b0bffbc75e
commit 13efb0a3a9
10 changed files with 420 additions and 74 deletions
+15
View File
@@ -25,6 +25,7 @@ import FaqDetail from "../views/FaqDetail.vue";
import Issues from "../views/Issues.vue";
import IssueDetail from "../views/IssueDetail.vue";
import Verification from "../views/Verification.vue";
import AuditLogs from "../views/admin/AuditLogs.vue";
import AdminUsers from "../views/admin/Users.vue";
import AdminProjects from "../views/admin/Projects.vue";
import ProjectMembers from "../views/admin/ProjectMembers.vue";
@@ -168,6 +169,12 @@ const routes: RouteRecordRaw[] = [
component: Verification,
meta: { title: "核查进度", requiresStudy: true },
},
{
path: "study/audit-logs",
name: "AuditLogs",
component: AuditLogs,
meta: { title: "审计日志", requiresStudy: true },
},
],
},
{
@@ -243,6 +250,14 @@ router.beforeEach(async (to, _from, next) => {
next({ path: "/studies" });
return;
}
if (to.name === "AuditLogs") {
const role = auth.user?.role;
const studyRole = studyStore.currentStudyRole;
if (!(role === "ADMIN" || role === "PM" || studyRole === "PM")) {
next({ path: "/study/home" });
return;
}
}
if (to.path.startsWith("/study") && !studyStore.currentStudy) {
next({ path: "/studies" });
return;