Преглед на файлове

feat: 增加案件不存在跳转

gemercheung преди 1 година
родител
ревизия
4f63097b98
променени са 1 файла, в които са добавени 6 реда и са изтрити 1 реда
  1. 6 1
      src/app.vue

+ 6 - 1
src/app.vue

@@ -51,13 +51,18 @@ const stopWatch = watch(currentLayout, async (layout) => {
   }
 
   params.share = true
-  await refreshCase()
+  try {
+    await refreshCase()
   if (caseProject.value) {
     await loadPack(initialSetting)
     prefix.value = caseProject.value!.caseTitle
   } else {
     await router.replace({name: RoutesName.error})
+  }  
+  } catch (error) {
+    await router.replace({name: RoutesName.error})
   }
+
   stopWatch()
   loaded.value = true
   console.log(loaded.value)