| | |
| | | |
| | | import * as AppApi from '@/api/system/app' |
| | | import {Apps} from "@/views/Home/types"; |
| | | import {CACHE_KEY, useCache} from "@/hooks/web/useCache"; |
| | | import {CACHE_KEY, useCache, useSessionCache} from "@/hooks/web/useCache"; |
| | | |
| | | |
| | | defineOptions({name: 'Home'}) |
| | | |
| | | const {wsCache} = useCache() |
| | | const {wsSessionCache} = useSessionCache() |
| | | |
| | | const loading = ref(true) |
| | | |
| | |
| | | const getAppMenuList = async (id, appCode) => { |
| | | const data = await AppApi.getAppMenuList(id) |
| | | let userInfo = wsCache.get(CACHE_KEY.USER) |
| | | userInfo.menus = data |
| | | // userInfo.menus = data |
| | | wsCache.set(CACHE_KEY.USER, userInfo) |
| | | wsCache.set(CACHE_KEY.ROLE_ROUTERS, data) |
| | | wsSessionCache.set(CACHE_KEY.ROLE_ROUTERS, data) |
| | | window.location.href = '/plat/index' |
| | | } |
| | | |
| | |
| | | if (type === 0) { |
| | | await getAppMenuList(id, appCode) |
| | | } else { |
| | | const data = await AppApi.getAppMenuList(id) |
| | | let userInfo = wsCache.get(CACHE_KEY.USER) |
| | | userInfo.menus = data |
| | | wsCache.set(CACHE_KEY.USER, userInfo) |
| | | wsCache.set(CACHE_KEY.ROLE_ROUTERS, data) |
| | | // const data = await AppApi.getAppMenuList(id) |
| | | // let userInfo = wsCache.get(CACHE_KEY.USER) |
| | | // userInfo.menus = data |
| | | // wsCache.set(CACHE_KEY.USER, userInfo) |
| | | // wsSessionCache.set(CACHE_KEY.ROLE_ROUTERS, data) |
| | | localStorage.setItem(appCode, id) |
| | | window.open(item.appDomain + '/index', '_blank') |
| | | // window.open('/plat/shasteel', '_blank') |
| | | // window.location.href = '/plat/shasteel' |