Ver código fonte

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

aamin 1 ano atrás
pai
commit
d95f43bbc8

+ 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()
     }
   }
 })