| | |
| | | import {isRelogin} from "@/config/axios/service"; |
| | | import router from "@/router"; |
| | | import type {RouteRecordRaw} from "vue-router"; |
| | | import {CACHE_KEY, useCache} from "@/hooks/web/useCache"; |
| | | import {CACHE_KEY, useCache, useSessionCache} from "@/hooks/web/useCache"; |
| | | import {getAccessToken} from "@/utils/auth"; |
| | | import {getInfo} from "@/api/login"; |
| | | const { wsCache } = useCache() |
| | | const { wsSessionCache } = useSessionCache() |
| | | |
| | | defineOptions({ name: 'Logo' }) |
| | | |
| | |
| | | |
| | | /** 刷新所有菜单权限 */ |
| | | const gotoHome = async () => { |
| | | const userStore = useUserStoreWithOut() |
| | | const permissionStore = usePermissionStoreWithOut() |
| | | isRelogin.show = true |
| | | wsCache.set(CACHE_KEY.USER, null) |
| | | await userStore.setUserInfoAction() |
| | | let userInfo = await getInfo() |
| | | wsCache.set(CACHE_KEY.USER, userInfo) |
| | | wsSessionCache.set(CACHE_KEY.ROLE_ROUTERS, userInfo.menus) |
| | | isRelogin.show = false |
| | | // 后端过滤菜单 |
| | | await permissionStore.generateRoutes() |