修复bug

This commit is contained in:
zhouyanli
2026-08-01 18:10:56 +08:00
parent f74fb33e11
commit 2010c63d70
7 changed files with 107 additions and 47 deletions

View File

@@ -148,8 +148,16 @@
complete: () => {}
});
}
let lastUserIdMy = ''
onShow(() =>{
getUserInfoData()
const token = uni.getStorageSync('token')
if (!token) return
const currentUserId = uni.getStorageSync('userId') || ''
// 仅登录状态变化时刷新,切后台回来直接用缓存
if (currentUserId !== lastUserIdMy) {
lastUserIdMy = currentUserId
getUserInfoData()
}
})
</script>