From bde2916433c7830e2879e6524e32b9f6c8bd0bab Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 02 一月 2022 16:31:32 +0800 Subject: [PATCH] 2022-01-02 --- src/api/cacheutils.js | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 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 () { -- Gitblit v1.8.0