-
-
-
{children}
+
+
+
+ {headerPathname === '/login' || headerPathname === '/join' ? (
+ {children}
+ ) : (
+
+
+
-
-
-
-
-
- )}
-
-
+
+
+
+ )}
+
+
+
)
diff --git a/src/components/main/MainContents.jsx b/src/components/main/MainContents.jsx
index 6d6ccd82..f20bfaf7 100644
--- a/src/components/main/MainContents.jsx
+++ b/src/components/main/MainContents.jsx
@@ -55,12 +55,26 @@ export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
})
const apiUrl = `${url}?${params.toString()}`
- const resultData = await get({ url: apiUrl })
+
+ try {
+ const resultData = await get({ url: apiUrl })
- if (resultData) {
- if (resultData.result.code === 200) {
- setFileList(resultData.data)
+ if (resultData) {
+ if (resultData.result.code === 200) {
+ setFileList(resultData.data)
+ }
}
+ } catch (error) {
+ console.error('π¨ ARCHIVE fetching error:', {
+ error,
+ timestamp: new Date().toISOString(),
+ apiUrl,
+ params: Object.fromEntries(params),
+ status: error.response?.status,
+ statusText: error.response?.statusText,
+ message: error.message,
+ stack: error.stack
+ })
}
}
@@ -82,7 +96,16 @@ export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
}
})
} catch (error) {
- console.error('NOTICE fetching error:', error)
+ console.error('π¨ NOTICE fetching error:', {
+ error,
+ timestamp: new Date().toISOString(),
+ apiUrl: noticeApiUrl,
+ params: param,
+ status: error.response?.status,
+ statusText: error.response?.statusText,
+ message: error.message,
+ stack: error.stack
+ })
}
}
@@ -106,7 +129,16 @@ export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
}
})
} catch (error) {
- console.error('FAQ fetching error:', error)
+ console.error('π¨ FAQ fetching error:', {
+ error,
+ timestamp: new Date().toISOString(),
+ apiUrl: faqApiUrl,
+ params: param,
+ status: error.response?.status,
+ statusText: error.response?.statusText,
+ message: error.message,
+ stack: error.stack
+ })
}
}
diff --git a/src/hooks/main/useMainContentsController.js b/src/hooks/main/useMainContentsController.js
index 1938a37a..d618d27e 100644
--- a/src/hooks/main/useMainContentsController.js
+++ b/src/hooks/main/useMainContentsController.js
@@ -53,7 +53,20 @@ export const useMainContentsController = () => {
})
} catch (error) {
setIsGlobalLoading(false)
- console.error('MAIN API fetching error:', error)
+ console.error('π¨ MAIN API fetching error:', {
+ error,
+ timestamp: new Date().toISOString(),
+ apiUrl,
+ session: {
+ storeId: session?.storeId,
+ userId: session?.userId,
+ builderNo: session?.builderNo
+ },
+ status: error.response?.status,
+ statusText: error.response?.statusText,
+ message: error.message,
+ stack: error.stack
+ })
}
}
diff --git a/src/hooks/useAxios.js b/src/hooks/useAxios.js
index b4b9652d..a5c1708a 100644
--- a/src/hooks/useAxios.js
+++ b/src/hooks/useAxios.js
@@ -38,13 +38,65 @@ export function useAxios(lang = '') {
})
// response μΆκ° λ‘μ§
- axios.interceptors.request.use(undefined, (error) => {})
+ axios.interceptors.response.use(
+ (response) => {
+ // 500 μλ¬ λ‘κΉ
+ if (response.status === 500) {
+ console.error('π¨ 500 Error Response:', {
+ url: response.config.url,
+ method: response.config.method,
+ status: response.status,
+ statusText: response.statusText,
+ timestamp: new Date().toISOString(),
+ requestData: response.config.data,
+ responseData: response.data
+ })
+ }
+ return response
+ },
+ (error) => {
+ // 500 μλ¬ λ° κΈ°ν μλ¬ λ‘κΉ
+ if (error.response?.status === 500) {
+ console.error('π¨ 500 Error Caught:', {
+ url: error.config?.url,
+ method: error.config?.method,
+ status: error.response?.status,
+ statusText: error.response?.statusText,
+ timestamp: new Date().toISOString(),
+ requestData: error.config?.data,
+ errorMessage: error.message,
+ errorStack: error.stack
+ })
+ } else {
+ console.error('π¨ API Error:', {
+ url: error.config?.url,
+ method: error.config?.method,
+ status: error.response?.status,
+ statusText: error.response?.statusText,
+ timestamp: new Date().toISOString(),
+ errorMessage: error.message
+ })
+ }
+ return Promise.reject(error)
+ }
+ )
const get = async ({ url, option = {} }) => {
return await getInstances(url)
.get(url, option)
.then((res) => res.data)
- .catch(console.error)
+ .catch((error) => {
+ console.error('π¨ GET Error:', {
+ url,
+ method: 'GET',
+ timestamp: new Date().toISOString(),
+ errorMessage: error.message,
+ status: error.response?.status,
+ statusText: error.response?.statusText,
+ config: error.config
+ })
+ throw error
+ })
}
const promiseGet = async ({ url, option = {} }) => {
@@ -55,7 +107,19 @@ export function useAxios(lang = '') {
return await getInstances(url)
.post(url, data, option)
.then((res) => res.data)
- .catch(console.error)
+ .catch((error) => {
+ console.error('π¨ POST Error:', {
+ url,
+ method: 'POST',
+ timestamp: new Date().toISOString(),
+ errorMessage: error.message,
+ status: error.response?.status,
+ statusText: error.response?.statusText,
+ requestData: data,
+ config: error.config
+ })
+ throw error
+ })
}
const promisePost = async ({ url, data, option = {} }) => {
@@ -66,7 +130,19 @@ export function useAxios(lang = '') {
return await getInstances(url)
.put(url, data, option)
.then((res) => res.data)
- .catch(console.error)
+ .catch((error) => {
+ console.error('π¨ PUT Error:', {
+ url,
+ method: 'PUT',
+ timestamp: new Date().toISOString(),
+ errorMessage: error.message,
+ status: error.response?.status,
+ statusText: error.response?.statusText,
+ requestData: data,
+ config: error.config
+ })
+ throw error
+ })
}
const promisePut = async ({ url, data, option = {} }) => {
@@ -77,7 +153,19 @@ export function useAxios(lang = '') {
return await getInstances(url)
.patch(url, data, option)
.then((res) => res.data)
- .catch(console.error)
+ .catch((error) => {
+ console.error('π¨ PATCH Error:', {
+ url,
+ method: 'PATCH',
+ timestamp: new Date().toISOString(),
+ errorMessage: error.message,
+ status: error.response?.status,
+ statusText: error.response?.statusText,
+ requestData: data,
+ config: error.config
+ })
+ throw error
+ })
}
const promisePatch = async ({ url, data, option = {} }) => {
@@ -88,7 +176,18 @@ export function useAxios(lang = '') {
return await getInstances(url)
.delete(url, option)
.then((res) => res.data)
- .catch(console.error)
+ .catch((error) => {
+ console.error('π¨ DELETE Error:', {
+ url,
+ method: 'DELETE',
+ timestamp: new Date().toISOString(),
+ errorMessage: error.message,
+ status: error.response?.status,
+ statusText: error.response?.statusText,
+ config: error.config
+ })
+ throw error
+ })
}
const promiseDel = async ({ url, option = {} }) => {