ZaiZai 6 months ago
parent
commit
a4a28a3086
2 changed files with 12 additions and 8 deletions
  1. 1 1
      public/version.json
  2. 11 7
      src/views/archives/rolling.vue

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20240816102221"
+  "value": "20240819094716"
 }

+ 11 - 7
src/views/archives/rolling.vue

@@ -59,10 +59,12 @@ watch(() => useAppState.getCollapse, (Collapse) => {
 })
 
 //渲染完成
-onMounted(() => {
-    getClassIfyList()
-    updateArchiveprogress()
-    Verification()
+onMounted(async () => {
+    getClassIfyList().then()
+    await updateArchiveprogress()
+    if (count.value < 100) {
+        Verification(false)
+    }
 })
 
 //树加载
@@ -218,7 +220,7 @@ const updateArchive = async () => {
         if (!error && code === 200) {
             window.$message?.success(data)
             count.value = 0
-            Verification()
+            Verification(true)
         }
     }
 }
@@ -239,10 +241,12 @@ const updateArchiveprogress = async () => {
 const timer = ref(null)
 let count = ref(0) // 倒计时
 //循环请求接口
-const Verification = () => {
+const Verification = (tip = true) => {
     timer.value = setInterval(() => {
         if (count.value == 100) {
-            window.$message.success('更新成功')
+            if (tip) {
+                window.$message.success('更新成功')
+            }
             clearInterval(timer.value)
         } else {
             updateArchiveprogress()// 请求数据