king
8 天以前 a1e9b18a4dbfd21e1bf4d5cb60974ac2f0115efd
src/api/cacheutils.js
@@ -27,9 +27,9 @@
        if (!window.GLOB.IndexDB.objectStoreNames.contains('caches')) {
          window.GLOB.IndexDB.createObjectStore('caches', { keyPath: 'menuid' })
        }
        if (!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 初始化失败!')
@@ -204,7 +204,7 @@
  /**
   * @description 获取IndexedDB中的配置信息
   */
  static getIndexDBCacheConfig (MenuID, limit) {
  static getIndexDBCacheConfig (MenuID) {
    if (!window.GLOB.IndexDB) return Promise.resolve()
    
    return new Promise((resolve, reject) => {
@@ -215,15 +215,7 @@
      }
      request.onsuccess = () => {
        if (limit && request.result) {
          if (request.result.CreateDate > limit) {
            resolve(request.result)
          } else {
            resolve()
          }
        } else {
          resolve(request.result)
        }
        resolve(request.result)
      }
    })
  }