Commit b6bc275a0d204e898b0d3fc349586ab1321b6372
1 parent
aed26d07
fix: remove old local data
Showing
1 changed file
with
5 additions
and
0 deletions
app.js
| ... | ... | @@ -2,6 +2,11 @@ |
| 2 | 2 | App({ |
| 3 | 3 | async onLaunch () { |
| 4 | 4 | this.login(); |
| 5 | + // 移除 2022-12-05 之前的本地存储,因为可能有敏感词存在 | |
| 6 | + const timestamp = new Date('2022-12-05').getTime(); | |
| 7 | + const audioList = this.globalData.getAudioList().filter(v => v.time > timestamp); | |
| 8 | + const storageKey = 'audioList'; | |
| 9 | + wx.setStorageSync(storageKey, audioList); | |
| 5 | 10 | }, |
| 6 | 11 | // 将登录态封装进去 |
| 7 | 12 | // todo: 多个请求同时发起,且登录态都失效时,ssid 会相互覆盖 | ... | ... |