File tree Expand file tree Collapse file tree 8 files changed +100
-21
lines changed
Expand file tree Collapse file tree 8 files changed +100
-21
lines changed Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import Icon404 from "../img/404.png" ;
3+ import { useNavigate } from "react-router-dom" ;
4+
5+ const Page404 = ( ) => {
6+ const navigate = useNavigate ( ) ;
7+ return (
8+ < div className = "relative top-[230px]" >
9+ < div className = "flex flex-col gap-[40px] items-center mx-auto w-[167px] h-[237px]" >
10+ < div >
11+ < img src = { Icon404 } alt = "404" />
12+ </ div >
13+ </ div >
14+ < div className = "flex flex-col items-center mx-auto" >
15+ < div className = "text-[20px] leading-[24px]" >
16+ 페이지를 찾을 수 없어요.
17+ </ div >
18+ < div className = "text-[20px] leading-[24px]" >
19+ 입력하신 주소를 다시 확인해주세요.
20+ </ div >
21+ </ div >
22+ < button
23+ onClick = { ( ) => {
24+ navigate ( "/main" ) ;
25+ } }
26+ className = "mt-[80px] mx-auto rounded-lg text-[16px] pt-[15px] font-semibold bg-[#002C51] text-white text-center align-middle w-[335px] h-[50px] justify-center flex shadow"
27+ >
28+ 홈으로 돌아가기
29+ </ button >
30+ </ div >
31+ ) ;
32+ } ;
33+
34+ export default Page404 ;
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import { useNavigate } from "react-router-dom" ;
3+ import Icon500 from "../img/500.png" ;
4+
5+ const Page500 = ( ) => {
6+ const navigate = useNavigate ( ) ;
7+ return (
8+ < div className = "relative top-[230px]" >
9+ < div className = "flex flex-col gap-[40px] items-center mx-auto w-[167px] h-[237px]" >
10+ < div >
11+ < img src = { Icon500 } alt = "500" />
12+ </ div >
13+ </ div >
14+ < div className = "flex flex-col items-center mx-auto " >
15+ < div className = "text-[20px] leading-[24px]" >
16+ 네트워크 연결 상태가 좋지 않아요.
17+ </ div >
18+ < div className = "text-[20px] leading-[24px]" >
19+ 잠시후 다시 시도해주세요.
20+ </ div >
21+ </ div >
22+ < button
23+ onClick = { ( ) => {
24+ navigate ( "/main" ) ;
25+ } }
26+ className = "mt-[80px] mx-auto rounded-lg text-[16px] pt-[15px] font-semibold bg-[#002C51] text-white text-center align-middle w-[335px] h-[50px] justify-center flex shadow"
27+ >
28+ 확인
29+ </ button >
30+ </ div >
31+ ) ;
32+ } ;
33+
34+ export default Page500 ;
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ import SetProfileNamePage from "./SetProfileNamePage";
1515import SignupPage from "./SingupPage" ;
1616import UserSearchPage from "./UserSearchPage" ;
1717import DevelopIng from "./DevelopIng" ;
18+ import Page404 from "./Page404" ;
19+ import Page500 from "./Page500" ;
1820
1921export {
2022 ChangePasswordPage ,
@@ -34,4 +36,6 @@ export {
3436 SignupPage ,
3537 UserSearchPage ,
3638 DevelopIng ,
39+ Page404 ,
40+ Page500 ,
3741} ;
Original file line number Diff line number Diff line change @@ -34,6 +34,12 @@ export const __emailLogin = createAsyncThunk(
3434 modalMessage : "이메일와 비밀번호를 \n 다시 한 번 확인해주세요." ,
3535 } ) ;
3636 payload . dispatch ( __openModal ( payload . dispatch ) ) ;
37+ } else {
38+ payload . setModalStr ( {
39+ modalTitle : "ID를 찾을 수 없어요." ,
40+ modalMessage : "이메일와 비밀번호를 \n 다시 한 번 확인해주세요." ,
41+ } ) ;
42+ payload . dispatch ( __openModal ( payload . dispatch ) ) ;
3743 }
3844 }
3945 }
Original file line number Diff line number Diff line change 11import axios from "axios" ;
2- import { useState } from "react" ;
3- import { useNavigate } from "react-router" ;
4- import LoadingPage from "../page/LoadingPage" ;
52
63export const instance = axios . create ( {
74 //로컬
@@ -28,23 +25,23 @@ instance.interceptors.request.use(
2825 }
2926) ;
3027
31- // instance.interceptors.response.use(
32- // function (response) {
33- // console.log(response);
34- // return response;
35- // },
36- // function (error) {
37- // const errMsg = error.response.status;
28+ instance . interceptors . response . use (
29+ function ( response ) {
30+ console . log ( response ) ;
31+ return response ;
32+ } ,
33+ function ( error ) {
34+ const errMsg = error . response . status ;
3835
39- // if (errMsg === 401) {
40- // window.location.href = "/login";
41- // return;
42- // }
36+ if ( errMsg === 401 ) {
37+ window . location . href = "/login" ;
38+ return ;
39+ }
4340
44- // if (errMsg === 500) {
45- // window.location.href = "/* ";
46- // return;
47- // }
48- // return Promise.reject(error);
49- // }
50- // );
41+ if ( errMsg === 500 ) {
42+ window . location . href = "/500error " ;
43+ return ;
44+ }
45+ return Promise . reject ( error ) ;
46+ }
47+ ) ;
Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ import {
2525 SignupPage ,
2626 LoginPage ,
2727 DevelopIng ,
28+ Page404 ,
29+ Page500 ,
2830} from "../page/index" ;
2931
3032const Router = ( ) => {
@@ -147,6 +149,8 @@ const Router = () => {
147149
148150 { /* 개발중 */ }
149151 < Route path = "/developing" element = { < DevelopIng /> } />
152+ < Route path = "/404error" element = { < Page404 /> } />
153+ < Route path = "/500error" element = { < Page500 /> } />
150154 </ Routes >
151155 </ Layout >
152156 ) ;
You can’t perform that action at this time.
0 commit comments