fix: keep brand navigation in active workbench
Release / release (push) Canceled after 0s

This commit is contained in:
Qiufeng
2026-08-17 23:03:03 +08:00
parent 3480d810d4
commit b679381946
7 changed files with 55 additions and 13 deletions
@@ -0,0 +1,13 @@
import type { RoleView } from '@/api/auth';
const fallbackWorkbenchRoutes: Record<string, string> = {
PROJECT_MANAGER: '/workbench/project',
FINANCE_MANAGER: '/workbench/finance',
ARCHIVE_MANAGER: '/workbench/archive',
SYSTEM_ADMIN: '/governance/settings',
};
export function resolveWorkbenchRoute(currentRole: string | null, roles: RoleView[]): string {
const configured = roles.find((role) => role.code === currentRole)?.workbenchRoute?.trim();
return configured || fallbackWorkbenchRoutes[currentRole || ''] || '/role-select';
}