Skip to content

Commit dc12bd1

Browse files
committed
新增错误页面401和404,以及其相关组件
1 parent d32dba0 commit dc12bd1

File tree

10 files changed

+184
-249
lines changed

10 files changed

+184
-249
lines changed

src/assets/img/error-images/401.png

70.8 KB
Loading

src/assets/img/error-images/404.png

22.9 KB
Loading

src/assets/img/error_images/404.png

-95.8 KB
Binary file not shown.
-4.65 KB
Binary file not shown.

src/assets/less/404.less

Lines changed: 0 additions & 188 deletions
This file was deleted.

src/assets/less/error-page.less

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
.error-wrapper {
2+
position: absolute;
3+
top: 40%;
4+
left: 50%;
5+
transform: translate(-50%, -50%);
6+
.error-content {
7+
.pic-error {
8+
float: left;
9+
width: 120%;
10+
overflow: hidden;
11+
opacity: 0;
12+
animation-name: slideUp;
13+
animation-duration: 0.5s;
14+
animation-delay: 0.3s;
15+
animation-fill-mode: forwards;
16+
img {
17+
width: 100%;
18+
height: 100%;
19+
}
20+
}
21+
.bullshit {
22+
position: relative;
23+
float: left;
24+
width: 300px;
25+
padding: 30px 0;
26+
overflow: hidden;
27+
&-oops {
28+
margin-bottom: 20px;
29+
font-size: 32px;
30+
font-weight: bold;
31+
line-height: 40px;
32+
color: #409eff;
33+
opacity: 0;
34+
animation-name: slideUp;
35+
animation-duration: 0.5s;
36+
animation-fill-mode: forwards;
37+
}
38+
&-headline {
39+
margin-bottom: 10px;
40+
font-size: 20px;
41+
font-weight: bold;
42+
line-height: 24px;
43+
color: #222;
44+
opacity: 0;
45+
animation-name: slideUp;
46+
animation-duration: 0.5s;
47+
animation-delay: 0.1s;
48+
animation-fill-mode: forwards;
49+
}
50+
&-info {
51+
margin-bottom: 30px;
52+
font-size: 13px;
53+
line-height: 21px;
54+
color: rgba(0, 0, 0, 0.65);
55+
opacity: 0;
56+
animation-name: slideUp;
57+
animation-duration: 0.5s;
58+
animation-delay: 0.2s;
59+
animation-fill-mode: forwards;
60+
}
61+
&-return-home {
62+
display: block;
63+
float: left;
64+
width: 110px;
65+
height: 36px;
66+
font-size: 14px;
67+
line-height: 36px;
68+
color: #fff;
69+
text-align: center;
70+
cursor: pointer;
71+
background: #409eff;
72+
border-radius: 100px;
73+
opacity: 0;
74+
animation-name: slideUp;
75+
animation-duration: 0.5s;
76+
animation-delay: 0.3s;
77+
animation-fill-mode: forwards;
78+
}
79+
}
80+
@keyframes slideUp {
81+
0% {
82+
opacity: 0;
83+
transform: translateY(60px);
84+
}
85+
100% {
86+
opacity: 1;
87+
transform: translateY(0);
88+
}
89+
}
90+
}
91+
}

src/router/index.js

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ export default new Router({
2121
hidden: true
2222
},
2323
{
24-
path: '/404',
25-
component: () => import('../views/404'),
24+
path: 'page-404',
25+
name: 'Page404',
26+
component: () => import('../views/error-page/404'),
2627
hidden: true
2728
},
2829
{
@@ -260,6 +261,34 @@ export default new Router({
260261
}
261262
}
262263
]
264+
},
265+
{
266+
path: '/error-page',
267+
name: 'ErrorPage',
268+
component: Layout,
269+
redirect: '/error-page/page-401',
270+
meta: {
271+
title: '错误页面',
272+
icon: 'vue-sys-icon-excel'
273+
},
274+
children: [
275+
{
276+
path: 'page-401',
277+
name: 'Page401',
278+
component: () => import('../views/error-page/401'),
279+
meta: {
280+
title: '401页面'
281+
}
282+
},
283+
{
284+
path: 'page-404',
285+
name: 'Page404',
286+
component: () => import('../views/error-page/404'),
287+
meta: {
288+
title: '404页面'
289+
}
290+
}
291+
]
263292
}
264293
]
265294
})

src/views/404.vue

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)