diff --git a/frontend/components/layout/AppLayout.tsx b/frontend/components/layout/AppLayout.tsx index 0ceb247b..02c7564f 100644 --- a/frontend/components/layout/AppLayout.tsx +++ b/frontend/components/layout/AppLayout.tsx @@ -409,7 +409,12 @@ function AppLayoutInner({ children }: AppLayoutProps) { if (pathname.startsWith("/admin") && pathname !== "/admin") { store.setMode("admin"); - store.openTab({ type: "admin", title: pathname.split("/").pop() || "관리자", admin_url: pathname }); + // menu API 가 실패하는 환경 (SUPER_ADMIN cross-tenant 등) 에서도 한글 라벨 유지 + const ADMIN_PATH_LABELS: Record = { + "/admin/userMng/deptMngList": "부서관리", + }; + const fallbackTitle = ADMIN_PATH_LABELS[pathname] || pathname.split("/").pop() || "관리자"; + store.openTab({ type: "admin", title: fallbackTitle, admin_url: pathname }); } }, []); @@ -903,15 +908,18 @@ function AppLayoutInner({ children }: AppLayoutProps) { }, [activeTab, uiMenus, isMenuActive]); // URL 직접 진입 / sessionStorage 복원 시 admin 탭의 영어 path-segment title 을 - // menu_name_kor (uiMenus 의 tabTitle/label/name) 로 한 번만 갱신. + // menu_name_kor (uiMenus 의 tabTitle/label/name) 로 갱신. + // menu API 가 실패한 환경 (SUPER_ADMIN cross-tenant) 에서도 동작하도록 hardcoded map 도 같이 검사. useEffect(() => { - if (uiMenus.length === 0) return; + const ADMIN_PATH_LABELS: Record = { + "/admin/userMng/deptMngList": "부서관리", + }; const store = useTabStore.getState(); for (const tab of store.admin.tabs) { if (tab.type !== "admin" || !tab.admin_url) continue; const matched = uiMenus.find((m: any) => m.url === tab.admin_url); const koreanTitle: string | undefined = - matched?.tabTitle || matched?.label || matched?.name; + matched?.tabTitle || matched?.label || matched?.name || ADMIN_PATH_LABELS[tab.admin_url]; if (koreanTitle && tab.title !== koreanTitle) { store.updateTabTitle(tab.id, koreanTitle); }