From 2044e07b3282fbe544581a8bd20290218d109ca9 Mon Sep 17 00:00:00 2001 From: ddcat1115 Date: Wed, 6 Sep 2017 18:12:47 +0800 Subject: [PATCH] improve exception --- src/common/nav.js | 4 ++-- src/components/Exception/index.js | 5 ++++- src/components/Exception/index.less | 11 ++++++++++- src/components/Exception/typeConfig.js | 6 +++--- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/common/nav.js b/src/common/nav.js index 50d71b85..c928a0c9 100644 --- a/src/common/nav.js +++ b/src/common/nav.js @@ -123,8 +123,8 @@ const data = [{ component: Error, }], }, { - name: '错误', - path: 'error', + name: '异常', + path: 'exception', icon: 'warning', children: [{ name: '403', diff --git a/src/components/Exception/index.js b/src/components/Exception/index.js index 560d782e..9f203535 100644 --- a/src/components/Exception/index.js +++ b/src/components/Exception/index.js @@ -12,7 +12,10 @@ export default ({ className, type, title, desc, img, actions }) => { return (
- +

{title || config[pageType].title}

diff --git a/src/components/Exception/index.less b/src/components/Exception/index.less index 37b639f9..6f1fefd2 100644 --- a/src/components/Exception/index.less +++ b/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 { diff --git a/src/components/Exception/typeConfig.js b/src/components/Exception/typeConfig.js index a1f018c8..3718d819 100644 --- a/src/components/Exception/typeConfig.js +++ b/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: '服务器错误,我们正在维修', }, -- GitLab