인터셉터 변경

This commit is contained in:
yoon 2025-02-25 14:38:47 +09:00
parent f4f5ac45f6
commit 9cd4b35ced

View File

@ -37,14 +37,11 @@ $api.interceptors.response.use(
},
function (error) {
const toastStore = useToastStore();
const currentPage = error.config.headers['X-Page-Route'];
// 오류 응답 처리
if (error.response) {
switch (error.response.status) {
case 401:
if (currentPage === '/login') {
toastStore.onToast('아이디 혹은 비밀번호가 틀렸습니다.', 'e');
} else {
if (!error.config.headers.isLogin) {
toastStore.onToast('인증이 필요합니다.', 'e');
}
break;