From 631ffa1727f4c49af22a6796575395d43e280b58 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Wed, 29 Oct 2025 11:06:40 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=ED=95=9C=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=EC=9E=90=EC=9D=98=20uuid=20=EC=B0=BE?= =?UTF-8?q?=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/store/common/auth/index.tsx | 29 ++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/apps/wr/app/store/common/auth/index.tsx b/apps/wr/app/store/common/auth/index.tsx index 7eceacb39..7b647d5e7 100644 --- a/apps/wr/app/store/common/auth/index.tsx +++ b/apps/wr/app/store/common/auth/index.tsx @@ -1,5 +1,6 @@ import { fetchType, getFetchWithCount } from "@/components/lib/api"; import { getUserInfo } from "@common/components/api"; +import { getCookie } from "@common/components/lib"; import toast from "react-hot-toast"; export type authState = { @@ -10,6 +11,7 @@ export type authState = { mdfcnAuthrtYn: string; delAuthrtYn: string; laeSeCd: string; + myUUID?: string; }; }; @@ -23,14 +25,15 @@ export const authStateExport: authState = { mdfcnAuthrtYn: "Y", delAuthrtYn: "Y", laeSeCd: "", + myUUID:'' }, }; export type authActions = { getMenuAuthrts: (menuCd: number) => void; getLaeSeCdCheck: () => Promise; + getMyUUID: () => Promise; }; - export const authActionsExport: (set: any, get: any) => authActions = ( set: any, get: any @@ -83,5 +86,29 @@ export const authActionsExport: (set: any, get: any) => authActions = ( console.error("laeSeCd check error", e); } }, + + getMyUUID: async () => { + try{ + const cached = get().auth.myUUID; + if (cached && cached !== "") { + return cached; + } + const tokenId = getCookie("token-id"); + + set((state: authState) => ({ + ...state, + auth: { + ...state.auth, + myUUID: tokenId, + }, + })); + + return tokenId; + }catch(e){ + console.error("getMyUUID error", e); + return undefined; + } + + }, }; };