瀏覽代碼

fix:解决首页登录无法返回的问题

aamin 1 年之前
父節點
當前提交
d95f43bbc8
共有 2 個文件被更改,包括 6 次插入2 次删除
  1. 3 1
      zhengquan/src/views/Game/gamePage.vue
  2. 3 1
      zhengquan/src/views/HomeMo/homePageMo.vue

+ 3 - 1
zhengquan/src/views/Game/gamePage.vue

@@ -27,7 +27,7 @@ onMounted(() => {
           pano: localStorage.getItem('currentPanoPath')
         }
       })
-    } else {
+    } else if (localStorage.getItem('currentUnit')) {
       router.replace({
         path: '/scene',
         query: {
@@ -35,6 +35,8 @@ onMounted(() => {
           name: store.currentUnit.name == '尾厅' ? '尾厅' : ''
         }
       })
+    } else {
+      router.back()
     }
 
   }

+ 3 - 1
zhengquan/src/views/HomeMo/homePageMo.vue

@@ -32,7 +32,7 @@ onMounted(() => {
           pano: localStorage.getItem('currentPanoPath')
         }
       })
-    } else {
+    } else if(localStorage.getItem('currentUnit') ) {
       router.replace({
         path: '/scene',
         query: {
@@ -40,6 +40,8 @@ onMounted(() => {
           name: store.currentUnit.name == '尾厅' ? '尾厅' : ''
         }
       })
+    }else {
+      router.back()
     }
   }
 })