From ae7f00b753b89ba2d157a53c716662080a3cc171 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 29 七月 2023 12:05:39 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/api/index.js |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/api/index.js b/src/api/index.js
index d2d5304..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) {
@@ -417,7 +418,7 @@
           if (list.length > 0) {
             let clear = false
             let _appkey = window.GLOB.appkey.substr(-10)
-            let reg = new RegExp(_appkey + '$', 'ig')
+            let reg = new RegExp(_appkey + '$', 'i')
 
             list.forEach(mid => {
               if (reg.test(mid)) {
@@ -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