修复(权限管理):统一 PM 系统导航与权限校验
This commit is contained in:
@@ -438,7 +438,7 @@ const routes: RouteRecordRaw[] = [
|
||||
path: "permissions/project",
|
||||
name: "AdminPermissionsProject",
|
||||
component: PermissionManagement,
|
||||
meta: { title: "项目权限配置", systemPermission: SYSTEM_PERMISSION_PROJECT_CONFIG },
|
||||
meta: { title: "项目访问控制", systemPermission: SYSTEM_PERMISSION_PROJECT_CONFIG },
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -592,8 +592,14 @@ router.beforeEach(async (to, _from, next) => {
|
||||
}
|
||||
|
||||
if (isDesktopRuntime && token && !isAdmin && to.path.startsWith("/admin")) {
|
||||
next({ path: DESKTOP_PROJECT_ENTRY_PATH });
|
||||
return;
|
||||
const hasPmProject = studyStore.currentStudyRole === "PM" || (studyStore.currentStudy as any)?.role_in_study === "PM";
|
||||
if (!hasPmProject) await studyStore.ensureDefaultPmStudy().catch(() => {});
|
||||
const canAccessProjectManagement = studyStore.currentStudyRole === "PM" || (studyStore.currentStudy as any)?.role_in_study === "PM";
|
||||
if (!canAccessProjectManagement) {
|
||||
next({ path: DESKTOP_PROJECT_ENTRY_PATH });
|
||||
return;
|
||||
}
|
||||
if (!studyStore.currentPermissions) await studyStore.loadCurrentStudyPermissions().catch(() => {});
|
||||
}
|
||||
|
||||
if (isDesktopRuntime && token && isAdmin && to.path.startsWith("/admin") && studyStore.currentStudy) {
|
||||
|
||||
Reference in New Issue
Block a user