bugfix:loginfiled
This commit is contained in:
@@ -21,10 +21,12 @@ Component({
|
||||
|
||||
lifetimes: {
|
||||
attached() {
|
||||
// 先用缓存渲染红点;未登录时不再发请求(否则会批量 401 并触发重定向)
|
||||
// 首帧渲染流程结束后再更新:先用缓存渲染红点,未登录时不再发请求(否则会批量 401 并触发重定向)
|
||||
const cached = (wx.getStorageSync(STORAGE_KEYS.UNREAD) as number) || 0
|
||||
this.setData({ unread: cached })
|
||||
this.syncUnread()
|
||||
wx.nextTick(() => {
|
||||
this.setData({ unread: cached })
|
||||
this.syncUnread()
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user