Browse Source

improve exception

ddcat1115 8 years ago
parent
commit
2044e07b32

+ 2 - 2
src/common/nav.js

@@ -123,8 +123,8 @@ const data = [{
       component: Error,
     }],
   }, {
-    name: '错误',
-    path: 'error',
+    name: '异常',
+    path: 'exception',
     icon: 'warning',
     children: [{
       name: '403',

+ 4 - 1
src/components/Exception/index.js

@@ -12,7 +12,10 @@ export default ({ className, type, title, desc, img, actions }) => {
   return (
     <div className={clsString}>
       <div className={styles.imgBlock}>
-        <img src={img || config[pageType].img} alt="" />
+        <div
+          className={styles.imgEle}
+          style={{ backgroundImage: `url(${img || config[pageType].img})` }}
+        />
       </div>
       <div className={styles.content}>
         <h1>{title || config[pageType].title}</h1>

+ 10 - 1
src/components/Exception/index.less

@@ -1,4 +1,5 @@
 @import "~antd/lib/style/themes/default.less";
+@import "../../utils/utils.less";
 
 .exception {
   display: flex;
@@ -8,8 +9,16 @@
   .imgBlock {
     flex: 0 0 62.5%;
     width: 62.5%;
-    text-align: right;
     padding-right: 152px;
+    .clearfix();
+  }
+
+  .imgEle {
+    height: 360px;
+    width: 430px;
+    float: right;
+    background-repeat: no-repeat;
+    background-position: 50% 50%;
   }
 
   .content {

+ 3 - 3
src/components/Exception/typeConfig.js

@@ -1,16 +1,16 @@
 const config = {
   403: {
-    img: 'https://gw.alipayobjects.com/zos/rmsportal/byTGXmzwJVwgotvxHQsU.svg',
+    img: 'https://gw.alipayobjects.com/zos/rmsportal/eKcaKpQhaYgsEzCnYKSV.svg',
     title: '403',
     desc: '对不起,你没有权限',
   },
   404: {
-    img: 'https://gw.alipayobjects.com/zos/rmsportal/GdXXOjtMMzaPfCziUVYt.svg',
+    img: 'https://gw.alipayobjects.com/zos/rmsportal/CSBcmGONHHPYIrPukBQW.svg',
     title: '404',
     desc: '你要找的页面不存在',
   },
   500: {
-    img: 'https://gw.alipayobjects.com/zos/rmsportal/OpTUNDbQGfEWLubSrJap.svg',
+    img: 'https://gw.alipayobjects.com/zos/rmsportal/BxwCjbIDiNOcmoEGMXfk.svg',
     title: '500',
     desc: '服务器错误,我们正在维修',
   },