| | |
| | | import { onBeforeUnmount, onMounted, ref } from 'vue' |
| | | import { fetchPermissionGuide } from '@/service/api/system' |
| | | import { fetchSysUserInfo } from '@/service/api/account' |
| | | import { useAuthStore, useRouteStore } from '@/store' |
| | | import { useAuthStore, useRouteStore, useTabStore } from '@/store' |
| | | import { local } from '@/utils' |
| | | import noPermissionBg from '@/assets/no-permission-bg.jpg' |
| | | |
| | | const authStore = useAuthStore() |
| | | const routeStore = useRouteStore() |
| | | const tabStore = useTabStore() |
| | | const guideLink = ref('') |
| | | let pollingTimer: ReturnType<typeof setInterval> | null = null |
| | | |
| | |
| | | clearInterval(pollingTimer) |
| | | pollingTimer = null |
| | | } |
| | | // 清空 tab 状态:tabStore 用 sessionStorage 持久化,整页刷新不会清; |
| | | // 若不主动清,历史上添加过的 /no-permission 页签会残留到首页 tab 栏旁边。 |
| | | // 首页作为 pinTab 会在下次进入时由路由守卫自动补回,无需担心丢失。 |
| | | tabStore.clearAllTabs() |
| | | window.location.href = '/' |
| | | } |
| | | // 仍无可访问菜单:留在无权限页,继续静默轮询,不再整页刷新 |