From a1e9b18a4dbfd21e1bf4d5cb60974ac2f0115efd Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 30 五月 2025 15:18:44 +0800
Subject: [PATCH] 2025-05-30

---
 src/api/cacheutils.js |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/api/cacheutils.js b/src/api/cacheutils.js
index f175333..b20d3f6 100644
--- a/src/api/cacheutils.js
+++ b/src/api/cacheutils.js
@@ -7,7 +7,7 @@
    */
   static openIndexDB (db) {
     try {
-      let request = window.indexedDB.open(db, 2)
+      let request = window.indexedDB.open(db, 3)
       request.onerror = () => {
         console.warn('IndexedDB 鍒濆鍖栧け璐ワ紒')
       }
@@ -27,9 +27,9 @@
         if (!window.GLOB.IndexDB.objectStoreNames.contains('caches')) {
           window.GLOB.IndexDB.createObjectStore('caches', { keyPath: 'menuid' })
         }
-        if (window.GLOB.systemType === '' && !window.GLOB.IndexDB.objectStoreNames.contains('funcs')) {
-          window.GLOB.IndexDB.createObjectStore('funcs', { keyPath: 'id' })
-        }
+        // if (!window.GLOB.IndexDB.objectStoreNames.contains('funcs')) {
+        //   window.GLOB.IndexDB.createObjectStore('funcs', { keyPath: 'id' })
+        // }
       }
     } catch (e) {
       console.warn('IndexedDB 鍒濆鍖栧け璐ワ紒')
@@ -72,6 +72,7 @@
       new Promise((resolve) => {
         let request = window.GLOB.IndexDB.transaction(['configs']).objectStore('configs').openCursor()
         let menus = []
+        let ids = []
 
         request.onerror = () => {
           resolve(menus)
@@ -80,7 +81,10 @@
         request.onsuccess = (e) => {
           let cursor = e.target.result
           if (cursor) {
-            menus.push(`'${cursor.value.menuid}','${cursor.value.open_edition || 'mk'}'`)
+            if (cursor.value.menuid && !ids.includes(cursor.value.menuid)) {
+              menus.push(`'${cursor.value.menuid}','${cursor.value.open_edition || 'mk'}'`)
+              ids.push(cursor.value.menuid)
+            }
             cursor.continue()
           } else {
             resolve(menus)
@@ -230,7 +234,7 @@
       request.onsuccess = (e) => {
         let cursor = e.target.result
         if (cursor) {
-          if (cursor.value.CreateDate < date) {
+          if (cursor.value.CreateDate < date || cursor.value.CreateDate.length === 10) {
             cursor.delete()
           }
           cursor.continue()

--
Gitblit v1.8.0