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 // APP
window.__onAppActive = () => { window.__onAppActive = () => {
this.autoTheme() this.autoTheme()
$A.IDBTest()
} }
// //
window.__onPagePause = () => { window.__onPagePause = () => {

View File

@ -541,7 +541,7 @@ const localforage = require("localforage");
if (height !== tmpHeight || width !== tmpWidth) { if (height !== tmpHeight || width !== tmpWidth) {
height = tmpHeight; height = tmpHeight;
width = tmpWidth; width = tmpWidth;
console.log(width, height); $A.openLog && console.log(width, height);
if (typeof callback === 'function') callback(); if (typeof callback === 'function') callback();
} }
}, 250); }, 250);
@ -1371,6 +1371,17 @@ const localforage = require("localforage");
$.extend({ $.extend({
__IDBTimer: {}, __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) { IDBSave(key, value, delay = 100) {
if (typeof this.__IDBTimer[key] !== "undefined") { if (typeof this.__IDBTimer[key] !== "undefined") {
clearTimeout(this.__IDBTimer[key]) clearTimeout(this.__IDBTimer[key])

View File

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