File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,15 @@ let homeRouter = [
2626 order : 1 ,
2727 right : [ '查询所有日志' ] ,
2828 } ,
29+ {
30+ title : '404' ,
31+ type : 'view' ,
32+ name : Symbol ( '404' ) ,
33+ route : '/404' ,
34+ filePath : 'views/error-page/404.vue' ,
35+ inNav : false ,
36+ icon : 'iconfont icon-rizhiguanli' ,
37+ } ,
2938 bookConfig ,
3039 adminConfig ,
3140]
Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ const routes = [
1616 name : 'login' ,
1717 component : ( ) => import ( '@/views/login/Login' ) ,
1818 } ,
19+ {
20+ redirect : '/404' ,
21+ path : '*' ,
22+ } ,
1923]
2024
2125export default routes
Original file line number Diff line number Diff line change 1+ <template >
2+ <div class =" container" ref =" container" >
3+ <img class =" page-404" src =" ../../assets/img/error-page/404.png" alt =" " >
4+ <img class =" page-logo" src =" ../../assets/img/error-page/logo.png" alt =" " >
5+ </div >
6+ </template >
7+
8+ <script type="text/ecmascript-6">
9+ export default {
10+ mounted () {
11+ const headerHeight = 72
12+ const { clientHeight } = document .body
13+ this .$refs .container .style .height = ` ${ clientHeight - headerHeight} px`
14+ },
15+ }
16+ </script >
17+
18+ <style scoped lang="scss">
19+ .container {
20+ display : flex ;
21+ justify-content : center ;
22+ align-items : center ;
23+ position : relative ;
24+ .page-404 {
25+ width : 349px ;
26+ height : 190px ;
27+ }
28+ .page-logo {
29+ position : absolute ;
30+ right : 40px ;
31+ bottom : 40px ;
32+ width : 60px ;
33+ height : 98px ;
34+ }
35+ }
36+ </style >
You can’t perform that action at this time.
0 commit comments