From 425eb39a861cd409bcf2f72eb6b5a54d6dfb4dfc Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Tue, 22 Jul 2025 16:01:48 +0900 Subject: [PATCH] =?UTF-8?q?middleware=20=EC=9E=91=EC=97=85=EC=A7=84?= =?UTF-8?q?=ED=96=89=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/dm/app/base.tsx | 22 ++++++++++++++++++++++ apps/dm/app/layout.tsx | 11 ++++------- apps/dm/components/ui/config/index.ts | 4 ++-- 3 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 apps/dm/app/base.tsx diff --git a/apps/dm/app/base.tsx b/apps/dm/app/base.tsx new file mode 100644 index 000000000..3905c9952 --- /dev/null +++ b/apps/dm/app/base.tsx @@ -0,0 +1,22 @@ +"use client"; + +import { BaseLayout } from "@common/components"; +import type { MenuItem } from "./store/common"; +import { useDmStore } from "./store"; +import { useRouter } from "next/navigation"; + +export default function Base({ + children, +}: Readonly<{ + children: React.ReactNode; +}>) { + const { getMenuAuth } = useDmStore((state) => state); + + const router = useRouter(); + const handleClick = (id:MenuItem) =>{ + getMenuAuth(id.menuCd); + router.push(id.urlPath); + } + + return {children}; +} diff --git a/apps/dm/app/layout.tsx b/apps/dm/app/layout.tsx index 0aac0da38..7c0f47a30 100644 --- a/apps/dm/app/layout.tsx +++ b/apps/dm/app/layout.tsx @@ -1,6 +1,5 @@ -"use client"; - -import { BaseLayout } from "@common/components"; +"use client" +import Base from "./base"; import "./globals.css"; import { StoreProvider } from "./store"; @@ -13,11 +12,9 @@ export default function RootLayout({ - - {children} - + {children} ); -} +} \ No newline at end of file diff --git a/apps/dm/components/ui/config/index.ts b/apps/dm/components/ui/config/index.ts index f54a9ff61..eb2379c7a 100644 --- a/apps/dm/components/ui/config/index.ts +++ b/apps/dm/components/ui/config/index.ts @@ -1,5 +1,5 @@ -import { PROXY_HOST, SERVER_API_URL, SERVER_API_WR_URL } from "@/src/shared/config/env"; +import { PROXY_HOST, SERVER_API_FO_URL, SERVER_API_URL, SERVER_API_WR_URL } from "@/src/shared/config/env"; export const LOCAL_URL = PROXY_HOST; -export const DEV_URL_FO = SERVER_API_URL; +export const DEV_URL_FO = SERVER_API_FO_URL; export const DEV_URL_WR = SERVER_API_WR_URL;