EthnaYeh лет назад: 7
Родитель
Сommit
17378e0a9d
4 измененных файлов с 110 добавлено и 19 удалено
  1. BIN
      src/assets/401_images/401.gif
  2. 2 1
      src/router/index.js
  3. 88 0
      src/views/errorPage/401.vue
  4. 20 18
      src/views/404.vue

BIN
src/assets/401_images/401.gif


+ 2 - 1
src/router/index.js

@@ -20,7 +20,8 @@ import Layout from '../views/layout/Layout'
20 20
 **/
21 21
 export const constantRouterMap = [
22 22
   { path: '/login', component: _import('login/index'), hidden: true },
23
-  { path: '/404', component: _import('404'), hidden: true },
23
+  { path: '/401', component: _import('errorPage/401'), hidden: true },
24
+  { path: '/404', component: _import('errorPage/404'), hidden: true },
24 25
 
25 26
   {
26 27
     path: '',

+ 88 - 0
src/views/errorPage/401.vue

@@ -0,0 +1,88 @@
1
+<template>
2
+  <div class="errPage-container">
3
+    <el-button @click="back" icon='arrow-left' class="pan-back-btn">返回</el-button>
4
+    <el-row>
5
+      <el-col :span="12">
6
+        <h1 class="text-jumbo text-ginormous">Oops!</h1>
7
+        gif来源<a href='https://zh.airbnb.com/' target='_blank'>airbnb</a> 页面
8
+        <h2>你没有权限去该页面</h2>
9
+        <h6>如有不满请联系你领导</h6>
10
+        <ul class="list-unstyled">
11
+          <li>或者你可以去:</li>
12
+          <li class="link-type">
13
+            <router-link to="/dashboard">回首页</router-link>
14
+          </li>
15
+          <li class="link-type"><a href="https://www.taobao.com/">随便看看</a></li>
16
+          <li><a @click.prevent="dialogVisible=true" href="#">点我看图</a></li>
17
+        </ul>
18
+      </el-col>
19
+      <el-col :span="12">
20
+        <img :src="errGif" width="313" height="428" alt="Girl has dropped her ice cream.">
21
+      </el-col>
22
+    </el-row>
23
+    <el-dialog title="随便看" :visible.sync="dialogVisible">
24
+      <img class="pan-img" :src="ewizardClap">
25
+    </el-dialog>
26
+  </div>
27
+</template>
28
+
29
+<script>
30
+import errGif from '@/assets/401_images/401.gif'
31
+
32
+export default {
33
+  name: 'page401',
34
+  data() {
35
+    return {
36
+      errGif: errGif + '?' + +new Date(),
37
+      ewizardClap: 'https://wpimg.wallstcn.com/007ef517-bafd-4066-aae4-6883632d9646',
38
+      dialogVisible: false
39
+    }
40
+  },
41
+  methods: {
42
+    back() {
43
+      if (this.$route.query.noGoBack) {
44
+        this.$router.push({ path: '/dashboard' })
45
+      } else {
46
+        this.$router.go(-1)
47
+      }
48
+    }
49
+  }
50
+}
51
+</script>
52
+
53
+<style rel="stylesheet/scss" lang="scss" scoped>
54
+  .errPage-container {
55
+    width: 800px;
56
+    margin: 100px auto;
57
+    .pan-back-btn {
58
+      background: #008489;
59
+      color: #fff;
60
+    }
61
+    .pan-gif {
62
+      margin: 0 auto;
63
+      display: block;
64
+    }
65
+    .pan-img {
66
+      display: block;
67
+      margin: 0 auto;
68
+    }
69
+    .text-jumbo {
70
+      font-size: 60px;
71
+      font-weight: 700;
72
+      color: #484848;
73
+    }
74
+    .list-unstyled {
75
+      font-size: 14px;
76
+      li {
77
+        padding-bottom: 5px;
78
+      }
79
+      a {
80
+        color: #008489;
81
+        text-decoration: none;
82
+        &:hover {
83
+          text-decoration: underline;
84
+        }
85
+      }
86
+    }
87
+  }
88
+</style>

+ 20 - 18
src/views/404.vue

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <div style="background:#f0f2f5;margin-top: -20px;">
2
+  <div style="background:#f0f2f5;margin-top: -20px;height:100%;">
3 3
     <div class="wscn-http404">
4 4
       <div class="pic-404">
5 5
         <img class="pic-404__parent" :src="img_404" alt="404">
@@ -9,7 +9,9 @@
9 9
       </div>
10 10
       <div class="bullshit">
11 11
         <div class="bullshit__oops">OOPS!</div>
12
-        <div class="bullshit__info">版权所有<a class="link-type" href="https://wallstreetcn.com" target='_blank'>华尔街见闻</a></div>
12
+        <div class="bullshit__info">版权所有
13
+          <a class='link-type' href='https://wallstreetcn.com' target='_blank'>华尔街见闻</a>
14
+        </div>
13 15
         <div class="bullshit__headline">{{ message }}</div>
14 16
         <div class="bullshit__info">请检查您输入的网址是否正确,请点击以下按钮返回主页或者发送错误报告</div>
15 17
         <a href="/" class="bullshit__return-home">返回首页</a>
@@ -19,22 +21,23 @@
19 21
 </template>
20 22
 
21 23
 <script>
22
- import img_404 from '@/assets/404_images/404.png'
23
- import img_404_cloud from '@/assets/404_images/404_cloud.png'
24
+import img_404 from '@/assets/404_images/404.png'
25
+import img_404_cloud from '@/assets/404_images/404_cloud.png'
24 26
 
25
- export default {
26
-   data() {
27
-     return {
28
-       img_404,
29
-       img_404_cloud
30
-     }
31
-   },
32
-   computed: {
33
-     message() {
34
-       return '特朗普说这个页面你不能进......'
35
-     }
36
-   }
37
- }
27
+export default {
28
+  name: 'page404',
29
+  data() {
30
+    return {
31
+      img_404,
32
+      img_404_cloud
33
+    }
34
+  },
35
+  computed: {
36
+    message() {
37
+      return '特朗普说这个页面你不能进......'
38
+    }
39
+  }
40
+}
38 41
 </script>
39 42
 
40 43
 <style rel="stylesheet/scss" lang="scss" scoped>
@@ -225,5 +228,4 @@
225 228
     }
226 229
   }
227 230
 }
228
-
229 231
 </style>