메뉴관리, 다국어관리, 토큰문제 해결
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user