에러페이지 수정
This commit is contained in:
parent
adbc5d0383
commit
00acd58995
@ -79,9 +79,10 @@ $api.interceptors.response.use(
|
||||
}
|
||||
|
||||
// 에러 응답에 커스텀 메시지가 포함되어 있다면 해당 메시지 사용
|
||||
if (error.response && error.response.data && error.response.data.message) {
|
||||
toastStore.onToast(error.response.data.message, 'e');
|
||||
} else if (error.response) {
|
||||
// if (error.response && error.response.data && error.response.data.message) {
|
||||
// toastStore.onToast(error.response.data.message, 'e');
|
||||
// } else if (error.response) {
|
||||
if (error.response) {
|
||||
// 기본 HTTP 에러 처리
|
||||
switch (error.response.status) {
|
||||
case 400:
|
||||
|
||||
@ -48,7 +48,6 @@ const fetchSentVacationCount = async () => {
|
||||
availableQuota.value = Math.max(maxQuota - sentCount.value, 0);
|
||||
grantCount.value = availableQuota.value;
|
||||
} catch (error) {
|
||||
console.error("🚨 연차 전송 기록 조회 실패:", error);
|
||||
availableQuota.value = maxQuota;
|
||||
grantCount.value = maxQuota;
|
||||
}
|
||||
|
||||
@ -95,11 +95,11 @@ const routes = [
|
||||
component: () => import('@v/admin/TheAuthorization.vue'),
|
||||
meta: { requiresAuth: true }
|
||||
},
|
||||
{ path: "/error/400", name: "Error400", component: () => import('@v/error/Error400.vue') },
|
||||
{ path: "/error/500", name: "Error500", component: () => import('@v/error/Error500.vue') },
|
||||
{ path: "/error/400", name: "Error400", component: () => import('@v/error/Error400.vue'), meta: {layout: 'NoLayout'} },
|
||||
{ path: "/error/500", name: "Error500", component: () => import('@v/error/Error500.vue'), meta: {layout: 'NoLayout'} },
|
||||
{
|
||||
path: "/:anything(.*)",
|
||||
name: "Error404", component: () => import('@v/error/Error404.vue')
|
||||
name: "Error404", component: () => import('@v/error/Error404.vue'), meta: {layout: 'NoLayout'}
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@ -52,7 +52,6 @@ async function fetchUsers() {
|
||||
isAdmin: user.MEMBERROL === 'ROLE_ADMIN',
|
||||
}));
|
||||
} catch (error) {
|
||||
console.error('사용자 목록을 불러오는 중 오류 발생:', error);
|
||||
toastStore.onToast('사용자 목록을 불러오지 못했습니다.', 'e');
|
||||
}
|
||||
}
|
||||
@ -83,7 +82,6 @@ async function toggleAdmin(user) {
|
||||
throw new Error('권한 변경 실패');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('권한 변경 중 오류 발생:', error);
|
||||
toastStore.onToast('권한 변경에 실패했습니다.', 'e');
|
||||
}
|
||||
}
|
||||
|
||||
@ -182,7 +182,6 @@ const handleSizeChange = () => {
|
||||
|
||||
// 일반 게시물 데이터 로드
|
||||
const fetchGeneralPosts = async (page = 1) => {
|
||||
try {
|
||||
const { data } = await axios.get("board/general", {
|
||||
params: {
|
||||
page,
|
||||
@ -223,14 +222,10 @@ const fetchGeneralPosts = async (page = 1) => {
|
||||
navigateLastPage: data.data.navigateLastPage
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("데이터 오류:", error);
|
||||
}
|
||||
};
|
||||
|
||||
// 공지사항 데이터 로드
|
||||
const fetchNoticePosts = async () => {
|
||||
try {
|
||||
const { data } = await axios.get("board/notices", {
|
||||
params: { searchKeyword: searchText.value }
|
||||
});
|
||||
@ -248,9 +243,6 @@ const fetchNoticePosts = async () => {
|
||||
commentCount : post.commentCount
|
||||
}));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("데이터 오류:", error);
|
||||
}
|
||||
};
|
||||
|
||||
// Enter 키를 눌렀을 때
|
||||
|
||||
@ -206,7 +206,6 @@
|
||||
link.remove();
|
||||
window.URL.revokeObjectURL(url);
|
||||
} catch (error) {
|
||||
console.error('파일 다운로드 오류:', error);
|
||||
alert('파일 다운로드 중 오류가 발생했습니다.');
|
||||
}
|
||||
};
|
||||
@ -272,7 +271,6 @@
|
||||
|
||||
// 좋아요, 싫어요
|
||||
const handleUpdateReaction = async ({ boardId, commentId, isLike, isDislike }) => {
|
||||
try {
|
||||
await axios.post(`/board/${boardId}/${commentId}/reaction`, {
|
||||
LOCBRDSEQ: boardId, // 게시글 id
|
||||
LOCCMTSEQ: commentId, //댓글 id
|
||||
@ -288,9 +286,6 @@
|
||||
|
||||
likeClicked.value = isLike;
|
||||
dislikeClicked.value = isDislike;
|
||||
} catch (error) {
|
||||
alert('오류가 발생했습니다.');
|
||||
}
|
||||
};
|
||||
|
||||
// 대댓글 좋아요
|
||||
@ -411,7 +406,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await axios.post(`board/${currentBoardId.value}/comment`, {
|
||||
LOCBRDSEQ: currentBoardId.value,
|
||||
LOCCMTRPY: comment,
|
||||
@ -427,9 +421,6 @@
|
||||
} else {
|
||||
alert('댓글 작성을 실패했습니다.');
|
||||
}
|
||||
} catch (error) {
|
||||
alert('오류가 발생했습니다.');
|
||||
}
|
||||
};
|
||||
|
||||
// 대댓글 추가
|
||||
|
||||
@ -129,16 +129,12 @@
|
||||
const fileError = ref('');
|
||||
|
||||
const fetchCategories = async () => {
|
||||
try {
|
||||
const response = await axios.get('board/categories');
|
||||
categoryList.value = response.data.data;
|
||||
const freeCategory = categoryList.value.find(category => category.CMNCODNAM === '자유');
|
||||
if (freeCategory) {
|
||||
categoryValue.value = freeCategory.CMNCODVAL;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('카테고리 불러오기 오류:', error);
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
@ -243,7 +239,6 @@
|
||||
toastStore.onToast('게시물이 작성되었습니다.', 's');
|
||||
goList();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
toastStore.onToast('게시물 작성 중 오류가 발생했습니다.', 'e');
|
||||
}
|
||||
};
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="error-container">
|
||||
<div class="error-page">
|
||||
<div class="error-content">
|
||||
<img src="/img/illustrations/page-misc-error-dark.png" alt="Error Illustration" class="error-image" />
|
||||
<h1>400</h1>
|
||||
|
||||
@ -264,7 +264,6 @@ async function loadCalendarData(year, month) {
|
||||
/* 프로필 구역 */
|
||||
// 프로필 클릭 시 모달 열기
|
||||
const handleProfileClick = async (user) => {
|
||||
try {
|
||||
if (isModalOpen.value && user.MEMBERSEQ === userStore.user.id) {
|
||||
return;
|
||||
}
|
||||
@ -281,9 +280,6 @@ const handleProfileClick = async (user) => {
|
||||
selectedUser.value = user;
|
||||
isGrantModalOpen.value = true;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("🚨 연차 데이터 불러오기 실패:", error);
|
||||
}
|
||||
};
|
||||
// 프로필 사원 리스트
|
||||
const fetchUserList = async () => {
|
||||
@ -309,7 +305,6 @@ const fetchUserList = async () => {
|
||||
};
|
||||
// 사원별 남은 연차 개수
|
||||
const fetchRemainingVacation = async () => {
|
||||
try {
|
||||
const response = await axios.get("vacation/remaining");
|
||||
if (response.status === 200) {
|
||||
remainingVacationData.value = response.data.data.reduce((acc, vacation) => {
|
||||
@ -317,9 +312,6 @@ const fetchRemainingVacation = async () => {
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("🚨 남은 연차 데이터를 불러오지 못했습니다:", error);
|
||||
}
|
||||
};
|
||||
// 로그인한 사원이 사용한 휴가 필터링
|
||||
const filteredMyVacations = computed(() => {
|
||||
@ -405,26 +397,21 @@ async function saveVacationChanges() {
|
||||
const currentDate = fullCalendarRef.value.getApi().getDate();
|
||||
await loadCalendarData(currentDate.getFullYear(), currentDate.getMonth() + 1);
|
||||
} catch (error) {
|
||||
console.error("🚨 휴가 변경 저장 실패:", error);
|
||||
toastStore.onToast('휴가 저장 요청에 실패했습니다.', 'e');
|
||||
}
|
||||
}
|
||||
/* 휴가 조회 */
|
||||
// 로그인 사용자의 연차 사용 내역
|
||||
async function fetchVacationHistory(year) {
|
||||
try {
|
||||
const response = await axios.get(`vacation/history?year=${year}`);
|
||||
if (response.status === 200 && response.data) {
|
||||
myVacations.value = response.data.data.usedVacations || [];
|
||||
receivedVacations.value = response.data.data.receivedVacations || []
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`🚨 휴가 데이터 불러오기 실패:`, error);
|
||||
}
|
||||
}
|
||||
// 모든 사원 연차 내역 및 그래프화
|
||||
async function fetchVacationData(year, month) {
|
||||
try {
|
||||
|
||||
const response = await axios.get(`vacation/list/${year}/${month}`);
|
||||
if (response.status === 200) {
|
||||
const vacationList = response.data;
|
||||
@ -449,11 +436,9 @@ async function fetchVacationData(year, month) {
|
||||
console.warn("📌 휴가 데이터를 불러오지 못함");
|
||||
return [];
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error fetching vacation data:", error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
// 캘린더 이벤트 업데이트
|
||||
function updateCalendarEvents() {
|
||||
const selectedEvents = Array.from(selectedDates.value)
|
||||
@ -514,7 +499,6 @@ const getVacationTypeClass = (type) => {
|
||||
};
|
||||
// 휴가종류
|
||||
const fetchVacationCodes = async () => {
|
||||
try {
|
||||
const response = await axios.get("vacation/codes");
|
||||
if (response.status === 200 && response.data) {
|
||||
vacationCodeMap.value = response.data.data.reduce((acc, item) => {
|
||||
@ -524,9 +508,6 @@ const fetchVacationCodes = async () => {
|
||||
} else {
|
||||
console.warn("❌ 공통 코드 데이터를 불러오지 못했습니다.");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("🚨 공통 코드 API 호출 실패:", error);
|
||||
}
|
||||
};
|
||||
const getVacationType = (typeCode) => {
|
||||
return vacationCodeMap.value[typeCode] || "기타";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user