From 2a3cc4e6cecfc6dab8b60adf93f7fde898ddc939 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 25 七月 2023 16:36:23 +0800
Subject: [PATCH] 2023-07-25

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

diff --git a/src/api/index.js b/src/api/index.js
index da12110..c30b55b 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -325,22 +325,23 @@
   }
 
   delCacheConfig (type = '') {
-    let date = moment().subtract(7, 'days').format('YYYY-MM-DD')
+    let date = moment().subtract(7, 'days').format('YYYY-MM-DD HH:mm:ss')
     CacheUtils.delIndexDBCacheConfig(date, type)
   }
 
   writeCacheConfig (menuid, data) {
     if (!menuid) return
-    let date = moment().format('YYYY-MM-DD')
+    let date = moment().format('YYYY-MM-DD HH:mm:ss')
     let _data = data ? JSON.stringify(data) : ''
 
     CacheUtils.writeCacheInIndexDB({menuid, CreateDate: date, LongParam: _data})
   }
 
-  getLCacheConfig (menuid) {
+  getLCacheConfig (menuid, minutes) {
     return new Promise((resolve, reject) => {
       if (window.GLOB.IndexDB) {
-        CacheUtils.getIndexDBCacheConfig(menuid).then(res => {
+        let limit = minutes ? moment().subtract(minutes, 'minutes').format('YYYY-MM-DD HH:mm:ss') : ''
+        CacheUtils.getIndexDBCacheConfig(menuid, limit).then(res => {
           if (res && res.LongParam) {
             let _data = JSON.parse(res.LongParam)
             if (_data.length === 0) {
@@ -428,6 +429,7 @@
               list = ''
             }
             CacheUtils.delIndexDBConfig(list)
+            this.delCacheConfig('all')
           }
 
           CacheUtils.updateIndexDBversion({version: res.app_version || '1.00', createDate: curTime})

--
Gitblit v1.8.0