123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <template>
- <div class="error layout-padding">
- <div class="layout-padding-auto layout-padding-view">
- <div class="error-flex">
- <div class="left">
- <div class="left-item">
- <div class="left-item-animation left-item-num">401</div>
- <div class="left-item-animation left-item-title">您未被授权,没有操作权限~</div>
- <div class="left-item-animation left-item-msg">您可以联系管理员帮您添加权限</div>
- <div class="left-item-animation left-item-btn">
- <el-button type="primary" round @click="onSetAuth">重新授权</el-button>
- </div>
- </div>
- </div>
- <div class="right">
- <img :src="getImageUrl('public/jurisdiction.png')" alt="" />
- </div>
- </div>
- </div>
- </div>
- </template>
- <script lang="ts">
- import { defineComponent } from 'vue';
- import { Session } from '/@/utils/storage';
- import { getImageUrl } from "/@/utils/tools";
- export default defineComponent({
- name: '401',
- setup() {
- const onSetAuth = () => {
- // https://gitee.com/lyt-top/vue-next-admin/issues/I5C3JS
- // 清除缓存/token等
- Session.clear();
- // 使用 reload 时,不需要调用 resetRoute() 重置路由
- window.location.reload();
- };
- return {
- onSetAuth,
- getImageUrl
- };
- },
- });
- </script>
- <style scoped lang="scss">
- .error {
- height: 100%;
- .error-flex {
- margin: auto;
- display: flex;
- height: 350px;
- width: 900px;
- .left {
- flex: 1;
- height: 100%;
- align-items: center;
- display: flex;
- .left-item {
- .left-item-animation {
- opacity: 0;
- animation-name: error-num;
- animation-duration: 0.5s;
- animation-fill-mode: forwards;
- }
- .left-item-num {
- color: var(--el-color-info);
- font-size: 55px;
- }
- .left-item-title {
- font-size: 20px;
- color: var(--el-text-color-primary);
- margin: 15px 0 5px 0;
- animation-delay: 0.1s;
- }
- .left-item-msg {
- color: var(--el-text-color-secondary);
- font-size: 12px;
- margin-bottom: 20px;
- animation-delay: 0.2s;
- }
- .left-item-btn {
- animation-delay: 0.2s;
- }
- }
- }
- .right {
- flex: 1;
- opacity: 0;
- animation-name: error-img;
- animation-duration: 2s;
- animation-fill-mode: forwards;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- }
- }
- </style>
|