perf: 优化iOS端数据读取失败的情况

This commit is contained in:
kuaifan 2024-03-17 17:21:29 +09:00
parent 4038d9560f
commit d34d94faa6
3 changed files with 14 additions and 1 deletions

View File

@ -290,6 +290,7 @@ export default {
// APP
window.__onAppActive = () => {
this.autoTheme()
$A.IDBTest()
}
//
window.__onPagePause = () => {

View File

@ -541,7 +541,7 @@ const localforage = require("localforage");
if (height !== tmpHeight || width !== tmpWidth) {
height = tmpHeight;
width = tmpWidth;
console.log(width, height);
$A.openLog && console.log(width, height);
if (typeof callback === 'function') callback();
}
}, 250);
@ -1371,6 +1371,17 @@ const localforage = require("localforage");
$.extend({
__IDBTimer: {},
async IDBTest() {
try {
if ($A.isIos()) {
await localforage.setItem('__test__', $A.Time())
}
$A.openLog && console.log('IDBTest OK',)
} catch (error) {
$A.openLog && console.error('IDBTest Error: ', error)
}
},
IDBSave(key, value, delay = 100) {
if (typeof this.__IDBTimer[key] !== "undefined") {
clearTimeout(this.__IDBTimer[key])

View File

@ -224,6 +224,7 @@
.ivu-tag {
margin: 0 4px 0 0;
padding: 0 5px;
box-sizing: content-box;
&.ivu-tag-success {
padding: 0 6px;
}