Skip to content

Commit 8593bcd

Browse files
author
pixel
committed
404不再全屏展示 方便退出和修改配置
1 parent 01f5dde commit 8593bcd

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

web/src/router/index.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ const baseRouters = [{
1818
name: 'register',
1919
component: () =>
2020
import ('@/view/login/register.vue')
21-
},
22-
{
23-
path: "/404",
24-
name: "404",
25-
component: () =>
26-
import ('@/view/error/index.vue')
2721
}
2822
]
2923

web/src/store/module/router.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,20 @@ export const router = {
3737
}]
3838
const asyncRouterRes = await asyncMenu()
3939
const asyncRouter = asyncRouterRes.data.menus
40+
asyncRouter.push({
41+
path: "404",
42+
name: "404",
43+
hidden: true,
44+
meta: {
45+
title: "迷路了*。*",
46+
},
47+
component: 'view/error/index.vue'
48+
})
4049
formatRouter(asyncRouter)
4150
baseRouter[0].children = asyncRouter
4251
baseRouter.push({
4352
path: '*',
44-
redirect: '/404'
53+
redirect: '/layout/404'
4554

4655
})
4756
asyncRouterHandle(baseRouter)

web/src/view/error/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<div class="inner">
55
<img src="../../assets/notFound.png">
66
<p>页面被神秘力量吸走了,请联系我们修复</p>
7+
<p style="font-size:18px;line-height:40px;">常见问题为菜单未分配仪表盘,可自行分配仪表盘或修改默认路由</p>
78
<p>↓</p>
89
<img src="../../assets/qm.png" class="leftPic">
910
</div>
@@ -21,7 +22,7 @@ export default {
2122
<style lang="scss">
2223
.big{
2324
width: 100%;
24-
height: 100vh;
25+
height: calc(100vh - 220px);
2526
background-color: rgb(244,244,244);
2627
position: relative;
2728
}

0 commit comments

Comments
 (0)