File tree 8 files changed +100
-21
lines changed
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";
15
15
import SignupPage from "./SingupPage" ;
16
16
import UserSearchPage from "./UserSearchPage" ;
17
17
import DevelopIng from "./DevelopIng" ;
18
+ import Page404 from "./Page404" ;
19
+ import Page500 from "./Page500" ;
18
20
19
21
export {
20
22
ChangePasswordPage ,
@@ -34,4 +36,6 @@ export {
34
36
SignupPage ,
35
37
UserSearchPage ,
36
38
DevelopIng ,
39
+ Page404 ,
40
+ Page500 ,
37
41
} ;
Original file line number Diff line number Diff line change @@ -34,6 +34,12 @@ export const __emailLogin = createAsyncThunk(
34
34
modalMessage : "이메일와 비밀번호를 \n 다시 한 번 확인해주세요." ,
35
35
} ) ;
36
36
payload . dispatch ( __openModal ( payload . dispatch ) ) ;
37
+ } else {
38
+ payload . setModalStr ( {
39
+ modalTitle : "ID를 찾을 수 없어요." ,
40
+ modalMessage : "이메일와 비밀번호를 \n 다시 한 번 확인해주세요." ,
41
+ } ) ;
42
+ payload . dispatch ( __openModal ( payload . dispatch ) ) ;
37
43
}
38
44
}
39
45
}
Original file line number Diff line number Diff line change 1
1
import axios from "axios" ;
2
- import { useState } from "react" ;
3
- import { useNavigate } from "react-router" ;
4
- import LoadingPage from "../page/LoadingPage" ;
5
2
6
3
export const instance = axios . create ( {
7
4
//로컬
@@ -28,23 +25,23 @@ instance.interceptors.request.use(
28
25
}
29
26
) ;
30
27
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 ;
38
35
39
- // if (errMsg === 401) {
40
- // window.location.href = "/login";
41
- // return;
42
- // }
36
+ if ( errMsg === 401 ) {
37
+ window . location . href = "/login" ;
38
+ return ;
39
+ }
43
40
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 {
25
25
SignupPage ,
26
26
LoginPage ,
27
27
DevelopIng ,
28
+ Page404 ,
29
+ Page500 ,
28
30
} from "../page/index" ;
29
31
30
32
const Router = ( ) => {
@@ -147,6 +149,8 @@ const Router = () => {
147
149
148
150
{ /* 개발중 */ }
149
151
< Route path = "/developing" element = { < DevelopIng /> } />
152
+ < Route path = "/404error" element = { < Page404 /> } />
153
+ < Route path = "/500error" element = { < Page500 /> } />
150
154
</ Routes >
151
155
</ Layout >
152
156
) ;
You can’t perform that action at this time.
0 commit comments