401.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <div class="error layout-padding">
  3. <div class="layout-padding-auto layout-padding-view">
  4. <div class="error-flex">
  5. <div class="left">
  6. <div class="left-item">
  7. <div class="left-item-animation left-item-num">401</div>
  8. <div class="left-item-animation left-item-title">您未被授权,没有操作权限~</div>
  9. <div class="left-item-animation left-item-msg">您可以联系管理员帮您添加权限</div>
  10. <div class="left-item-animation left-item-btn">
  11. <el-button type="primary" round @click="onSetAuth">重新授权</el-button>
  12. </div>
  13. </div>
  14. </div>
  15. <div class="right">
  16. <SvgIcon name="iconfont icon-quanxianweihu" size="120px" class="color-primary" />
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. </template>
  22. <script setup lang="ts" name="401">
  23. import { Session, Cookie } from '@/utils/storage';
  24. const onSetAuth = () => {
  25. // https://gitee.com/lyt-top/vue-next-admin/issues/I5C3JS
  26. // 清除缓存/token等
  27. Session.clear();
  28. Cookie.clear();
  29. // 使用 reload 时,不需要调用 resetRoute() 重置路由
  30. window.location.reload();
  31. };
  32. </script>
  33. <style scoped lang="scss">
  34. .error {
  35. height: 100%;
  36. .error-flex {
  37. margin: auto;
  38. display: flex;
  39. height: 350px;
  40. width: 900px;
  41. .left {
  42. flex: 1;
  43. height: 100%;
  44. align-items: center;
  45. display: flex;
  46. .left-item {
  47. .left-item-animation {
  48. opacity: 0;
  49. animation-name: error-num;
  50. animation-duration: 0.5s;
  51. animation-fill-mode: forwards;
  52. }
  53. .left-item-num {
  54. color: var(--el-color-info);
  55. font-size: 55px;
  56. }
  57. .left-item-title {
  58. font-size: 20px;
  59. color: var(--el-text-color-primary);
  60. margin: 15px 0 5px 0;
  61. animation-delay: 0.1s;
  62. }
  63. .left-item-msg {
  64. color: var(--el-text-color-secondary);
  65. font-size: 12px;
  66. margin-bottom: 20px;
  67. animation-delay: 0.2s;
  68. }
  69. .left-item-btn {
  70. animation-delay: 0.2s;
  71. }
  72. }
  73. }
  74. .right {
  75. flex: 1;
  76. opacity: 0;
  77. animation-name: error-img;
  78. animation-duration: 2s;
  79. animation-fill-mode: forwards;
  80. display: flex;
  81. align-items: center;
  82. justify-content: center;
  83. }
  84. }
  85. }
  86. </style>