Commit 2044e07b authored by ddcat1115's avatar ddcat1115

improve exception

parent 6ecfedde
...@@ -123,8 +123,8 @@ const data = [{ ...@@ -123,8 +123,8 @@ const data = [{
component: Error, component: Error,
}], }],
}, { }, {
name: '错误', name: '异常',
path: 'error', path: 'exception',
icon: 'warning', icon: 'warning',
children: [{ children: [{
name: '403', name: '403',
......
...@@ -12,7 +12,10 @@ export default ({ className, type, title, desc, img, actions }) => { ...@@ -12,7 +12,10 @@ export default ({ className, type, title, desc, img, actions }) => {
return ( return (
<div className={clsString}> <div className={clsString}>
<div className={styles.imgBlock}> <div className={styles.imgBlock}>
<img src={img || config[pageType].img} alt="" /> <div
className={styles.imgEle}
style={{ backgroundImage: `url(${img || config[pageType].img})` }}
/>
</div> </div>
<div className={styles.content}> <div className={styles.content}>
<h1>{title || config[pageType].title}</h1> <h1>{title || config[pageType].title}</h1>
......
@import "~antd/lib/style/themes/default.less"; @import "~antd/lib/style/themes/default.less";
@import "../../utils/utils.less";
.exception { .exception {
display: flex; display: flex;
...@@ -8,8 +9,16 @@ ...@@ -8,8 +9,16 @@
.imgBlock { .imgBlock {
flex: 0 0 62.5%; flex: 0 0 62.5%;
width: 62.5%; width: 62.5%;
text-align: right;
padding-right: 152px; padding-right: 152px;
.clearfix();
}
.imgEle {
height: 360px;
width: 430px;
float: right;
background-repeat: no-repeat;
background-position: 50% 50%;
} }
.content { .content {
......
const config = { const config = {
403: { 403: {
img: 'https://gw.alipayobjects.com/zos/rmsportal/byTGXmzwJVwgotvxHQsU.svg', img: 'https://gw.alipayobjects.com/zos/rmsportal/eKcaKpQhaYgsEzCnYKSV.svg',
title: '403', title: '403',
desc: '对不起,你没有权限', desc: '对不起,你没有权限',
}, },
404: { 404: {
img: 'https://gw.alipayobjects.com/zos/rmsportal/GdXXOjtMMzaPfCziUVYt.svg', img: 'https://gw.alipayobjects.com/zos/rmsportal/CSBcmGONHHPYIrPukBQW.svg',
title: '404', title: '404',
desc: '你要找的页面不存在', desc: '你要找的页面不存在',
}, },
500: { 500: {
img: 'https://gw.alipayobjects.com/zos/rmsportal/OpTUNDbQGfEWLubSrJap.svg', img: 'https://gw.alipayobjects.com/zos/rmsportal/BxwCjbIDiNOcmoEGMXfk.svg',
title: '500', title: '500',
desc: '服务器错误,我们正在维修', desc: '服务器错误,我们正在维修',
}, },
......
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