| | |
| | | } |
| | | |
| | | /** |
| | | * @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) { |