From f0266d192ee6b997dc1a5884fe34e758f5b8f756 Mon Sep 17 00:00:00 2001 From: seondal Date: Fri, 12 Apr 2024 22:16:51 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat=20:=20=20=EC=84=B8=EC=85=98?= =?UTF-8?q?=EB=A7=8C=EB=A3=8C=20(415)=20=EC=BD=94=EB=93=9C=20=EC=A0=95?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/config/privateApi.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/apis/config/privateApi.ts b/src/apis/config/privateApi.ts index c719df25..02fa5c04 100644 --- a/src/apis/config/privateApi.ts +++ b/src/apis/config/privateApi.ts @@ -18,13 +18,12 @@ const privateApi: CustomInstance = axios.create({ privateApi.interceptors.response.use( (response) => response.data, (error) => { - if (error.response.status === 401) { - if (confirm('세션이 만료되었습니다. 다시 로그인해주세요!')) { - location.href = '/auth/logout'; - } + if (error.response.status === 415) { + alert('세션이 만료되었어요. 다시 로그인이 필요해요!'); } else { - alert('오류가 발생했습니다. 다시 시도해주세요!'); + alert('오류가 발생했어요. 다시 로그인해주세요!'); } + location.href = '/auth/logout'; return Promise.reject(error); } );