From 9259c2235e31708f954a3578bde3c6a7ab9753e8 Mon Sep 17 00:00:00 2001
From: houzhongjian <houzhongyi@126.com>
Date: 星期一, 30 十二月 2024 15:51:40 +0800
Subject: [PATCH] 1、工作流相关组件更新 2、偶尔出现退出登录时路由报错的bug导致无法回到登录页面 3、全局配置文件修改,移除VITE_UPLOAD_URL配置等

---
 src/views/Home/Index.vue |   35 ++++++++++++++++++++---------------
 1 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/src/views/Home/Index.vue b/src/views/Home/Index.vue
index 0993b39..1558788 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,10 +45,10 @@
 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)
-  window.location.href = '/plat/index'
+  wsSessionCache.set(CACHE_KEY.ROLE_ROUTERS, data)
+  window.location.href = import.meta.env.VITE_BASE_PATH + 'index'
 }
 
 const getAllApi = async () => {
@@ -63,18 +64,18 @@
 const gotoApp = async (item) => {
   let path = window.location.pathname
   let appName = path.split("/")[0]
-  console.log(appName)
   let id = item.id
   let type = item.type
   let appCode = item.appCode
   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'
@@ -94,33 +95,35 @@
   font-size: 40px;
   color: #282F3D;
 }
+
 #app {
   margin: 0 96px;
   width: 100%;
 }
+
 .card {
   width: 354px;
   height: 200px;
   margin: 0 24px 24px 0;
-  background: linear-gradient( 180deg, #E9F0FA 0%, #FFFFFF 100%);
+  background: linear-gradient(180deg, #E9F0FA 0%, #FFFFFF 100%);
   border-radius: 12px 12px 12px 12px;
   border: 2px solid;
   border-image: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 1)) 2 2;
   display: inline-block;
 }
-.card > div{
-  display: inline-block;
-}
-.card-left{
+
+.card-left {
   height: 100px;
   width: 100px;
   float: left;
   margin: 50px 30px;
 }
+
 .card-right {
   float: right;
   margin: 61px 10px;
 }
+
 .app-title {
   width: 162px;
   font-family: Microsoft YaHei, Microsoft YaHei;
@@ -128,6 +131,7 @@
   font-size: 24px;
   color: #282F3D;
 }
+
 .goto-app {
   width: 96px;
   height: 35px;
@@ -136,6 +140,7 @@
   border-radius: 80px 80px 80px 80px;
   cursor: pointer;
 }
+
 .goto-app > div {
   padding: 6px;
   margin-left: 5px;

--
Gitblit v1.9.3