diff --git a/apps/wr/app/(map-layout)/layout.tsx b/apps/wr/app/(map-layout)/layout.tsx
index d11fafb72..a44714aa2 100644
--- a/apps/wr/app/(map-layout)/layout.tsx
+++ b/apps/wr/app/(map-layout)/layout.tsx
@@ -1,12 +1,25 @@
"use client";
+import type { MenuItem } from "@common/components/api";
import { NoFooterLayout } from "@common/components/ui";
+import { usePathname,useRouter } from "next/navigation";
+import { useWrStore } from "../store";
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
+ const { getMenuAuthrts } = useWrStore((state) => state);
+ const router = useRouter();
+ const pathname = usePathname();
+
+ const changeMenu = (path: MenuItem) => {
+ getMenuAuthrts(path.menuCd);
+ router.push(path.urlPath);
+ };
return (
- {children}
+
+ {children}
+
);
}
diff --git a/apps/wr/components/lib/api/index.ts b/apps/wr/components/lib/api/index.ts
index fd1287793..6b1f4292c 100644
--- a/apps/wr/components/lib/api/index.ts
+++ b/apps/wr/components/lib/api/index.ts
@@ -41,7 +41,10 @@ export const getFetch = async (type: string, url: string) => {
// JSON 응답 처리
const res = await response.json();
return res.data;
- } else {
+ } else if(contentType.includes('application/octet-stream')) {
+ // 파일 응답 처리 (ex. PDF, Excel 등)
+
+ console.log('contentType ' ,contentType)
// 파일 응답 처리 (ex. PDF, Excel 등)
const blob = await response.blob();
const blobUrl = window.URL.createObjectURL(blob);
@@ -54,7 +57,9 @@ export const getFetch = async (type: string, url: string) => {
window.URL.revokeObjectURL(blobUrl);
return null; // 다운로드이므로 반환값 없음
- }
+ }else{
+ throw Error('오류 발생')
+ }
};
export const getFetchWithCount = async (type: string, url: string) => {
@@ -89,8 +94,10 @@ export const getFetchWithCount = async (type: string, url: string) => {
const res = await response.json();
return res;
- } else {
+ } else if(contentType.includes('application/octet-stream')) {
// 파일 응답 처리 (ex. PDF, Excel 등)
+
+ console.log('contentType ' ,contentType)
const blob = await response.blob();
const blobUrl = window.URL.createObjectURL(blob);
const a = document.createElement("a");
@@ -102,7 +109,9 @@ export const getFetchWithCount = async (type: string, url: string) => {
window.URL.revokeObjectURL(blobUrl);
return null; // 다운로드이므로 반환값 없음
- }
+ }else{
+ throw Error('오류 발생')
+ }
};
export const postFectch = async (url: string, params: any, type?: string) => {