Forráskód Böngészése

fix: 问题修复

7746 2 napja
szülő
commit
10dde920a3
1 módosított fájl, 9 hozzáadás és 2 törlés
  1. 9 2
      src/pages/home/index.vue

+ 9 - 2
src/pages/home/index.vue

@@ -117,7 +117,12 @@ const changeTabsFn = async (newTabIndex) => {
  */
 const changeStoreFn = row => {
   storageStore.updateActivedId(row.storageId);
-  window.location.href = '/';
+  if (showBackIcon.value) {
+    router.back()
+  }
+  setTimeout(() => {
+    window.location.reload()
+  }, 500)
 }
 
 const fetchNoticeData = async () => {
@@ -146,10 +151,12 @@ onMounted(async () => {
   // 判断本地存储仓库id是否存在
   if (storeList.value && storeList.value.length > 0) {
     if (storageStore.activedId) {
-      const isExist = storeList.value.find(item => item.storageId == storageStore.activedId);
+      const isExist = storeList.value.some(item => item.storageId == storageStore.activedId);
       if (!isExist) {
         storageStore.updateActivedId(storeList.value[0].storageId);
       }
+    } else {
+      storageStore.updateActivedId(storeList.value[0].storageId);
     }
     fetchNoticeData();
     fetchgetAmityList();