Commit 7ef9f012 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

添加404 500页面

parent 9d767d1e
export default {
'/api': {
'target': 'http://10.0.0.129:8100/',
'target': 'http://10.0.0.25:8100/',
'changeOrigin': true,
'pathRewrite': { '^/api' : '' },
}
......
......@@ -24,7 +24,15 @@ const router = [
component: '@/pages/user/policy'
},
]
}
},
{
path: '/404',
component: '@/pages/404',
},
{
path: '/500',
component: '@/pages/500',
},
]
export default router
\ No newline at end of file
import React from 'react';
import { history } from 'umi';
import { Button, Row, Col } from 'antd';
import { GlobalConfig } from '@/global/config';
import UserHeader from '../layouts/components/UserHeader';
import styles from './index.less'
import Img from '../../mockStatic/illus.png'
const NoFoundPage: React.FC<{}> = () => {
const handleReturn = () => {
history.go(-1)
}
return (
<div className={styles.wrapper}>
<UserHeader logo={GlobalConfig.global.logo}/>
<div className={styles.errorBox}>
<Row>
<Col span={12}>
<div className={styles.desc}>
<h1>哎呀!页面未找到</h1>
<h4>该错误可能由于如下原因所致:</h4>
<p>·页面已失效</p>
<p>·页面已修改或者删除</p>
<Button
type="primary"
size="large"
style={{marginTop: 100}}
onClick={handleReturn}
>返回到主页</Button>
</div>
</Col>
<Col span={12}>
<img className={styles.image} src={Img} alt="数商云服务"/>
</Col>
</Row>
</div>
</div>
)
}
export default NoFoundPage;
import React from 'react';
import { history } from 'umi';
import { Button, Row, Col } from 'antd';
import { GlobalConfig } from '@/global/config';
import UserHeader from '../layouts/components/UserHeader';
import styles from './index.less'
import Img from '../../mockStatic/Artwork.png'
const InternetError: React.FC<{}> = () => {
const handleReload = () => {
history.go(-1)
}
return (
<div className={styles.wrapper}>
<UserHeader logo={GlobalConfig.global.logo}/>
<div className={styles.errorBox}>
<Row>
<Col span={12}>
<div className={styles.desc}>
<h1>哎呀!网络连接出错了</h1>
<h4>该错误可能由于如下原因所致:</h4>
<p>·电脑未连接到网络</p>
<p>·防火墙或杀毒软件阻止</p>
<Button
type="primary"
size="large"
style={{marginTop: 100}}
onClick={handleReload}
>刷新页面试试</Button>
</div>
</Col>
<Col span={12}>
<img className={styles.image} src={Img} alt="数商云服务"/>
</Col>
</Row>
</div>
</div>
)
}
export default InternetError;
.normal {
}
.title {
font-size: 24px;
color: #666;
}
// 500 error
// .wrapper{
// }
.errorBox{
width: 100%;
.desc{
width: 400px;
margin: 200px auto 0;
}
.image {
display: block;
width: 100%;
height: 100%;
}
}
......@@ -124,7 +124,7 @@
}
.formBoxStep1 {
width: 320px;
width: 324px;
.make-center-space(margin, 40, 0);
}
......
......@@ -380,7 +380,7 @@ const UserRegistry = () => {
useEffect(() => {
if(time === 0){
clearInterval(timeChange)
setTime(5)
setTime(60)
history.push('/user/login')
console.log('执行登录跳转!')
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment