Browse Source

🚧 修复可能的报错问题

快乐的梦鱼 1 month ago
parent
commit
f2852856c8
3 changed files with 5 additions and 0 deletions
  1. 2 0
      src/App.vue
  2. 1 0
      src/pages/village/detail.vue
  3. 2 0
      src/pages/village/index.vue

+ 2 - 0
src/App.vue

@@ -39,6 +39,8 @@ registryConvert();
 const authStore = useAuthStore();
 
 onMounted(() => {
+  if (import.meta.server)
+    return;
   authStore.loadLoginState();
 });
 

+ 1 - 0
src/pages/village/detail.vue

@@ -121,6 +121,7 @@ watch(route, () => {
 }, { immediate: true })
 
 async function loadInfo() {
+
   loading.value = true;
   const id = Number(route.query.id);
   data.value = {

+ 2 - 0
src/pages/village/index.vue

@@ -24,6 +24,8 @@ const route = useRoute();
 const router = useRouter();
 
 async function showDetail(item: any) {
+  if (import.meta.server)
+    return;
   localStorage.setItem('VillageTemp', JSON.stringify(item));
   setTimeout(() => {
     router.push({