403.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <div class="error-container">
  3. <div class="error-content">
  4. <el-row :gutter="20">
  5. <el-col :lg="12" :md="12" :sm="24" :xl="12" :xs="24">
  6. <div class="pic-error">
  7. <el-image class="pic-error-parent" :src="require('@/assets/error_images/403.png')" />
  8. <el-image class="pic-error-child left" :src="require('@/assets/error_images/cloud.png')" />
  9. </div>
  10. </el-col>
  11. <el-col :lg="12" :md="12" :sm="24" :xl="12" :xs="24">
  12. <div class="bullshit">
  13. <div class="bullshit-oops">{{ oops }}</div>
  14. <div class="bullshit-headline">{{ headline }}</div>
  15. <div class="bullshit-info">{{ info }}</div>
  16. <router-link class="bullshit-return-home" to="/">{{ jumpTime }}s&nbsp;{{ btn }}</router-link>
  17. </div>
  18. </el-col>
  19. </el-row>
  20. </div>
  21. </div>
  22. </template>
  23. <script>
  24. import { mapActions, mapGetters } from 'vuex'
  25. export default {
  26. name: 'Page403',
  27. beforeRouteLeave(to, from, next) {
  28. this.delVisitedRoute(this.$route.path)
  29. clearInterval(this.timer)
  30. next()
  31. },
  32. data() {
  33. return {
  34. jumpTime: 5,
  35. oops: '抱歉!',
  36. headline: '您没有操作角色...',
  37. info: '当前帐号没有操作角色,请联系管理员。',
  38. btn: '返回',
  39. timer: 0,
  40. }
  41. },
  42. computed: {
  43. ...mapGetters({
  44. visitedRoutes: 'tabs/visitedRoutes',
  45. }),
  46. },
  47. mounted() {
  48. this.timeChange()
  49. },
  50. methods: {
  51. ...mapActions({
  52. delVisitedRoute: 'tabs/delVisitedRoute',
  53. }),
  54. timeChange() {
  55. this.timer = setInterval(() => {
  56. if (this.jumpTime) {
  57. this.jumpTime--
  58. } else {
  59. this.delVisitedRoute(this.$route.path)
  60. this.$router.push('/')
  61. clearInterval(this.timer)
  62. }
  63. }, 1000)
  64. },
  65. },
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. .error-container {
  70. position: relative;
  71. min-height: 100vh;
  72. .error-content {
  73. position: absolute;
  74. top: 55%;
  75. left: 50%;
  76. width: 40vw;
  77. height: 400px;
  78. transform: translate(-50%, -50%);
  79. .pic-error {
  80. position: relative;
  81. float: left;
  82. width: 100%;
  83. overflow: hidden;
  84. &-parent {
  85. width: 100%;
  86. }
  87. &-child {
  88. position: absolute;
  89. &.left {
  90. top: 17px;
  91. left: 220px;
  92. width: 80px;
  93. opacity: 0;
  94. animation-name: cloudLeft;
  95. animation-duration: 2s;
  96. animation-timing-function: linear;
  97. animation-delay: 1s;
  98. animation-fill-mode: forwards;
  99. }
  100. @keyframes cloudLeft {
  101. 0% {
  102. top: 17px;
  103. left: 220px;
  104. opacity: 0;
  105. }
  106. 20% {
  107. top: 33px;
  108. left: 188px;
  109. opacity: 1;
  110. }
  111. 80% {
  112. top: 81px;
  113. left: 92px;
  114. opacity: 1;
  115. }
  116. 100% {
  117. top: 97px;
  118. left: 60px;
  119. opacity: 0;
  120. }
  121. }
  122. }
  123. }
  124. .bullshit {
  125. position: relative;
  126. float: left;
  127. width: 300px;
  128. padding: 30px 0;
  129. overflow: hidden;
  130. &-oops {
  131. margin-bottom: 20px;
  132. font-size: 32px;
  133. font-weight: bold;
  134. line-height: 40px;
  135. color: $base-color-blue;
  136. opacity: 0;
  137. animation-name: slideUp;
  138. animation-duration: 0.5s;
  139. animation-fill-mode: forwards;
  140. }
  141. &-headline {
  142. margin-bottom: 10px;
  143. font-size: 20px;
  144. font-weight: bold;
  145. line-height: 24px;
  146. color: #222;
  147. opacity: 0;
  148. animation-name: slideUp;
  149. animation-duration: 0.5s;
  150. animation-delay: 0.1s;
  151. animation-fill-mode: forwards;
  152. }
  153. &-info {
  154. margin-bottom: 30px;
  155. font-size: 13px;
  156. line-height: 21px;
  157. color: $base-color-grey;
  158. opacity: 0;
  159. animation-name: slideUp;
  160. animation-duration: 0.5s;
  161. animation-delay: 0.2s;
  162. animation-fill-mode: forwards;
  163. }
  164. &-return-home {
  165. display: block;
  166. float: left;
  167. width: 110px;
  168. height: 36px;
  169. font-size: 14px;
  170. line-height: 36px;
  171. color: #fff;
  172. text-align: center;
  173. cursor: pointer;
  174. background: $base-color-blue;
  175. border-radius: 100px;
  176. opacity: 0;
  177. animation-name: slideUp;
  178. animation-duration: 0.5s;
  179. animation-delay: 0.3s;
  180. animation-fill-mode: forwards;
  181. }
  182. @keyframes slideUp {
  183. 0% {
  184. opacity: 0;
  185. transform: translateY(60px);
  186. }
  187. 100% {
  188. opacity: 1;
  189. transform: translateY(0);
  190. }
  191. }
  192. }
  193. }
  194. }
  195. </style>