From f6626b05f1275cc2f8ca77f773d4f6a6af1b0a89 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 21 十一月 2022 16:11:55 +0800
Subject: [PATCH] 2022-11-21

---
 src/views/imdesign/index.jsx |   58 ++++++++++++++++++++++++++++------------------------------
 1 files changed, 28 insertions(+), 30 deletions(-)

diff --git a/src/views/imdesign/index.jsx b/src/views/imdesign/index.jsx
index 2d6eeab..47ab0c1 100644
--- a/src/views/imdesign/index.jsx
+++ b/src/views/imdesign/index.jsx
@@ -188,41 +188,39 @@
   }
 
   getAppPictures = () => {
-    if (sessionStorage.getItem('app_videos') || sessionStorage.getItem('app_pictures')) return
-
-    Api.getSystemConfig({
+    if (sessionStorage.getItem('app_pictures')) return
+    
+    let deffers = []
+    let param = {
       func: 's_url_db_adduptdel',
       PageIndex: 0,  // 0 浠h〃鍏ㄩ儴
       PageSize: 0,   // 0 浠h〃鍏ㄩ儴
-      typecharone: 'image',
       type: 'search'
-    }).then(res => {
-      if (res.status) {
-        sessionStorage.setItem('app_pictures', JSON.stringify(res.data || []))
-      }
+    }
+    deffers = [new Promise(resolve => {
+      setTimeout(() => {
+        Api.getSystemConfig({...param, typecharone: 'image'}).then(res => {
+          resolve(res.data)
+        })
+      }, 500)
+    }), new Promise(resolve => {
+      setTimeout(() => {
+        Api.getSystemConfig({...param, typecharone: 'video'}).then(res => {
+          resolve(res.data)
+        })
+      }, 1000)
+    }), new Promise(resolve => {
+      setTimeout(() => {
+        Api.getSystemConfig({...param, typecharone: 'color'}).then(res => {
+          resolve(res.data)
+        })
+      }, 1500)
+    })]
 
-      Api.getSystemConfig({
-        func: 's_url_db_adduptdel',
-        PageIndex: 0,  // 0 浠h〃鍏ㄩ儴
-        PageSize: 0,   // 0 浠h〃鍏ㄩ儴
-        typecharone: 'video',
-        type: 'search'
-      }).then(res => {
-        if (res.status) {
-          sessionStorage.setItem('app_videos', JSON.stringify(res.data || []))
-        }
-      })
-      Api.getSystemConfig({
-        func: 's_url_db_adduptdel',
-        PageIndex: 0,  // 0 浠h〃鍏ㄩ儴
-        PageSize: 0,   // 0 浠h〃鍏ㄩ儴
-        typecharone: 'color',
-        type: 'search'
-      }).then(res => {
-        if (res.status) {
-          sessionStorage.setItem('app_colors', JSON.stringify(res.data || []))
-        }
-      })
+    Promise.all(deffers).then(response => {
+      sessionStorage.setItem('app_pictures', JSON.stringify(response[0] || []))
+      sessionStorage.setItem('app_videos', JSON.stringify(response[1] || []))
+      sessionStorage.setItem('app_colors', JSON.stringify(response[2] || []))
     })
   }
 

--
Gitblit v1.8.0