Commit fe5d5f25f115de2915ccfa742e494a7e928b95c7

Authored by wangfan
1 parent 2b3317aa

fix "cache" 垃圾回收

Showing 1 changed file with 22 additions and 0 deletions
... ... @@ -155,5 +155,27 @@ App({
}
})
})
},
onHide(){
console.log('obHide');
let time=new Date()/1000;
wx.getStorageInfo({
success:(res)=>{
console.log(res.keys);
if(res.keys.length>0){
res.keys.forEach(key=>{
wx.getStorage({
key:key,
success:(ca)=>{
//console.log('obHide',ca.data.timeout,time);
if(ca.data.timeout && ca.data.timeout<time){
wx.removeStorage({key:key})
}
}
})
})
}
},
})
}
})
\ No newline at end of file
... ...