index.tsx
958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { Link, history } from 'umi';
import { Result, Button } from 'antd';
import { HomeOutlined, ArrowLeftOutlined } from '@ant-design/icons';
type ExceptionPageProps = {
showGoBackLink?: boolean;
buttons?: any;
};
export default (props: ExceptionPageProps) => (
<Result
status="404"
title="404"
style={{
background: 'none',
}}
subTitle="很抱歉,您访问的页面不存在或您已无权限。"
extra={
<>
{typeof props.showGoBackLink === 'undefined' || props.showGoBackLink ? (
<Button
type="primary"
onClick={() => {
history.goBack();
}}
>
<ArrowLeftOutlined />
返回上一页
</Button>
) : null}
{props.buttons}
<Link to="/">
<Button>
<HomeOutlined />
首页
</Button>
</Link>
</>
}
/>
);