Skip to content

Commit 8576692

Browse files
authored
Merge pull request #114 from WithTime12/develop
2 parents 5bd0ffe + 1ab1188 commit 8576692

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/api/axiosInstance.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let isRedirecting = false;
1818
axiosInstance.interceptors.response.use(
1919
(response) => response,
2020
async (error) => {
21-
if (error.response?.data.error === 'Unauthorized') {
21+
if (error.status === 401) {
2222
if (isRedirecting) {
2323
return Promise.reject(error);
2424
}
@@ -35,18 +35,17 @@ axiosInstance.interceptors.response.use(
3535

3636
if (refreshResponse.code === '200') {
3737
isRedirecting = false;
38-
3938
return axiosInstance(error.config);
4039
}
4140
} catch (errors) {
4241
if (axios.isAxiosError(errors)) {
4342
const refreshError = errors as AxiosError<IRefreshResponse>;
44-
if (refreshError.response?.data.message === 'The token is null.') {
43+
if (refreshError.status === 401) {
4544
console.error('refreshToken이 없습니다. 로그인 페이지로 이동합니다.');
4645
void logout();
4746
localStorage.clear();
48-
} else if (refreshError.response?.data.message === 'The token is invalid.') {
49-
console.error('refreshToken이 만료되었습니다. 로그인 페이지로 이동합니다.');
47+
} else if (refreshError.status === 404) {
48+
console.error('사용자 정보를 찾지 못했습니다. 로그인 페이지로 이동합니다.');
5049
void logout();
5150
localStorage.clear();
5251
} else {

src/components/layout/Footer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function Footer() {
77
{/* 상단 */}
88
<ul className="flex flex-wrap gap-x-4 gap-y-2 text-sm font-caption text-default-gray-800">
99
<li>
10-
<Link to="/">개인정보 처리방침</Link>
10+
<div onClick={() => alert('아직 지원하지 않는 기능이에요')}>개인정보 처리방침</div>
1111
</li>
1212
<span>|</span>
1313
<li>
@@ -20,7 +20,7 @@ export default function Footer() {
2020
</li>
2121
<span>|</span>
2222
<li>
23-
<Link to="/">고객문의</Link>
23+
<div onClick={() => alert('아직 지원하지 않는 기능이에요')}>고객문의</div>
2424
</li>
2525
</ul>
2626

0 commit comments

Comments
 (0)