Showing
1 changed file
with
22 additions
and
0 deletions
| @@ -155,5 +155,27 @@ App({ | @@ -155,5 +155,27 @@ App({ | ||
| 155 | } | 155 | } |
| 156 | }) | 156 | }) |
| 157 | }) | 157 | }) |
| 158 | + }, | ||
| 159 | + onHide(){ | ||
| 160 | + console.log('obHide'); | ||
| 161 | + let time=new Date()/1000; | ||
| 162 | + wx.getStorageInfo({ | ||
| 163 | + success:(res)=>{ | ||
| 164 | + console.log(res.keys); | ||
| 165 | + if(res.keys.length>0){ | ||
| 166 | + res.keys.forEach(key=>{ | ||
| 167 | + wx.getStorage({ | ||
| 168 | + key:key, | ||
| 169 | + success:(ca)=>{ | ||
| 170 | + //console.log('obHide',ca.data.timeout,time); | ||
| 171 | + if(ca.data.timeout && ca.data.timeout<time){ | ||
| 172 | + wx.removeStorage({key:key}) | ||
| 173 | + } | ||
| 174 | + } | ||
| 175 | + }) | ||
| 176 | + }) | ||
| 177 | + } | ||
| 178 | + }, | ||
| 179 | + }) | ||
| 158 | } | 180 | } |
| 159 | }) | 181 | }) |
-
Please register or login to post a comment