메뉴관리, 다국어관리, 토큰문제 해결

This commit is contained in:
kjs
2025-08-21 14:47:07 +09:00
parent 71d34ffd88
commit 86017c257d
14 changed files with 881 additions and 227 deletions

View File

@@ -1,4 +1,5 @@
import { useMultiLang } from "@/hooks/useMultiLang";
import { apiClient } from "../api/client";
// 메뉴 관리 화면 다국어 키 상수
export const MENU_MANAGEMENT_KEYS = {
@@ -194,18 +195,12 @@ export const getMenuTextSync = (key: string, params?: Record<string, any>): stri
// 비동기적으로 번역 로드 (백그라운드에서)
if (typeof window !== "undefined") {
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8080";
const companyCode = "*";
fetch(`${API_BASE_URL}/multilang/user-text/${companyCode}/MENU_MANAGEMENT/${key}?userLang=${userLang}`, {
credentials: "include",
headers: {
"Content-Type": "application/json",
},
})
.then((response) => response.json())
.then((data) => {
if (data.success && data.data) {
apiClient
.get(`/multilang/user-text/${companyCode}/MENU_MANAGEMENT/${key}?userLang=${userLang}`)
.then((response) => {
if (response.data.success && response.data.data) {
// 개별 캐시에 저장
const currentCache = (window as any).__TRANSLATION_CACHE || {};
currentCache[cacheKey] = data.data;