From 42f07f34717a9c20914b75fe7c1a8212766e970d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 24 十月 2021 16:26:47 +0800 Subject: [PATCH] 2021-10-24 --- src/api/cacheutils.js | 20 ++++++++++++++++++++ src/api/index.js | 1 + src/components/header/index.jsx | 4 ++-- src/tabviews/commontable/index.jsx | 1 - 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/api/cacheutils.js b/src/api/cacheutils.js index aa742fc..3a983a0 100644 --- a/src/api/cacheutils.js +++ b/src/api/cacheutils.js @@ -43,6 +43,26 @@ } /** + * @description 娓呯┖鍑芥暟 + */ + static clearFuncs (sysType) { + if (sysType !== 'local' || window.GLOB.systemType !== '') return + if (window.GLOB.WebSql) { + window.GLOB.WebSql.transaction(tx => { + tx.executeSql('DELETE FROM FUNCS') + + tx.executeSql(`UPDATE VERSIONS SET createDate='1970-01-01 14:59:09.000' where CDefine1='funcs'`) + }) + } else if (window.GLOB.IndexDB) { + let objectStore = window.GLOB.IndexDB.transaction(['funcs'], 'readwrite').objectStore('funcs') + objectStore.clear() + + let funcStore = window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version') + funcStore.put({id: 'funcs', version: '1.0', createDate: '1970-01-01 14:59:09.000'}) + } + } + + /** * @description 鑾峰彇websql涓繚瀛樹俊鎭増鏈� */ static getWebSqlVersion () { diff --git a/src/api/index.js b/src/api/index.js index 08baa38..50f0f42 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -403,6 +403,7 @@ CacheUtils.updateWebSqlversion('1.00', curTime) CacheUtils.clearIndexDBConfig() CacheUtils.updateIndexDBversion({version: '1.00', createDate: curTime}) + CacheUtils.clearFuncs(options.sysType) } /** diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index fc866fa..0c8f549 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -629,7 +629,7 @@ if (!window.GLOB.WebSql && !window.GLOB.IndexDB) { notification.warning({ top: 92, - message: '鍗囩骇澶辫触锛岃鍒锋柊椤甸潰閲嶈瘯锛�', + message: '鏇存柊澶辫触锛岃鍒锋柊椤甸潰閲嶈瘯锛�', duration: 2 }) resolve() @@ -638,7 +638,7 @@ setTimeout(() => { notification.success({ top: 92, - message: '鍗囩骇鎴愬姛锛�', + message: '鏇存柊鎴愬姛锛�', duration: 2 }) resolve() diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index 1e13b23..070e950 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -398,7 +398,6 @@ } }) } - console.log(config) this.setState({ loadingview: false, -- Gitblit v1.8.0