From b2298c8c996dd176c2bd7d424a1aa709cbb97965 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 05 二月 2021 15:34:21 +0800
Subject: [PATCH] 2021-02-05

---
 src/api/cacheutils.js |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/src/api/cacheutils.js b/src/api/cacheutils.js
index 71983c5..2aa5642 100644
--- a/src/api/cacheutils.js
+++ b/src/api/cacheutils.js
@@ -306,6 +306,31 @@
   }
 
   /**
+   * @description 鍒犻櫎IndexedDB涓繚瀛樼殑閰嶇疆淇℃伅-鎵归噺
+   */
+  static delIndexDBConfig (keys) {
+    if (!window.GLOB.IndexDB || !keys) return
+
+    let objectStore = window.GLOB.IndexDB.transaction(['configs'], 'readwrite').objectStore('configs')
+
+    objectStore.openCursor().onsuccess = (event) => {
+      let cursor = event.target.result
+
+      if (cursor) {
+        if (cursor.value && keys.includes(cursor.value.menuid)) {
+          let request = objectStore.delete(cursor.key)
+
+          request.onerror = () => {
+            window.GLOB.IndexDB = null
+          }
+        }
+
+        cursor.continue()
+      }
+    }
+  }
+
+  /**
    * @description 鑾峰彇IndexedDB涓殑閰嶇疆淇℃伅
    */
   static getIndexDBMenuConfig (MenuID, userid) {

--
Gitblit v1.8.0