| | |
| | | } |
| | | |
| | | /** |
| | | * @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 () { |
| | |
| | | CacheUtils.updateWebSqlversion('1.00', curTime) |
| | | CacheUtils.clearIndexDBConfig() |
| | | CacheUtils.updateIndexDBversion({version: '1.00', createDate: curTime}) |
| | | CacheUtils.clearFuncs(options.sysType) |
| | | } |
| | | |
| | | /** |
| | |
| | | if (!window.GLOB.WebSql && !window.GLOB.IndexDB) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '升级失败,请刷新页面重试!', |
| | | message: '更新失败,请刷新页面重试!', |
| | | duration: 2 |
| | | }) |
| | | resolve() |
| | |
| | | setTimeout(() => { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '升级成功!', |
| | | message: '更新成功!', |
| | | duration: 2 |
| | | }) |
| | | resolve() |
| | |
| | | } |
| | | }) |
| | | } |
| | | console.log(config) |
| | | |
| | | this.setState({ |
| | | loadingview: false, |