From 2717813966ced88c6a1635663dd01b502158a1b8 Mon Sep 17 00:00:00 2001 From: houzhongjian <houzhongyi@126.com> Date: 星期四, 05 十二月 2024 17:01:36 +0800 Subject: [PATCH] 1、路由信息存储与session 2、修改与脚手架的跳转对接方式 --- src/views/Home/Index.vue | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/views/Home/Index.vue b/src/views/Home/Index.vue index 738039c..e931277 100644 --- a/src/views/Home/Index.vue +++ b/src/views/Home/Index.vue @@ -25,12 +25,13 @@ 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) @@ -44,9 +45,9 @@ 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' } @@ -70,11 +71,12 @@ 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' -- Gitblit v1.9.3