File tree Expand file tree Collapse file tree 1 file changed +23
-31
lines changed
Expand file tree Collapse file tree 1 file changed +23
-31
lines changed Original file line number Diff line number Diff line change 1- import React , { Component } from "react" ;
1+ import React from "react" ;
22import { Button , Row , Col } from "antd" ;
3- import { connect } from "react-redux" ;
4- import errImg from '@/assets/images/404.png'
3+ import errImg from "@/assets/images/404.png" ;
54import "./index.less" ;
65
7- /*
8- 前台404页面
9- */
10- class NotFound extends Component {
11- goHome = ( ) => {
12- this . props . history . replace ( "/" ) ;
13- } ;
6+ const NotFound = ( props ) => {
7+ const { history } = props ;
8+ const goHome = ( ) => history . replace ( "/" ) ;
9+ return (
10+ < Row className = "not-found" >
11+ < Col span = { 12 } >
12+ < img src = { errImg } alt = "404" />
13+ </ Col >
14+ < Col span = { 12 } className = "right" >
15+ < h1 > 404</ h1 >
16+ < h2 > 抱歉,你访问的页面不存在</ h2 >
17+ < div >
18+ < Button type = "primary" onClick = { goHome } >
19+ 回到首页
20+ </ Button >
21+ </ div >
22+ </ Col >
23+ </ Row >
24+ ) ;
25+ } ;
1426
15- render ( ) {
16- return (
17- < Row className = "not-found" >
18- < Col span = { 12 } >
19- < img src = { errImg } alt = "404" />
20- </ Col >
21- < Col span = { 12 } className = "right" >
22- < h1 > 404</ h1 >
23- < h2 > 抱歉,你访问的页面不存在</ h2 >
24- < div >
25- < Button type = "primary" onClick = { this . goHome } >
26- 回到首页
27- </ Button >
28- </ div >
29- </ Col >
30- </ Row >
31- ) ;
32- }
33- }
34-
35- export default connect ( ) ( NotFound ) ;
27+ export default NotFound ;
You can’t perform that action at this time.
0 commit comments