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