修复bug

This commit is contained in:
zhouyanli
2026-08-04 15:43:20 +08:00
parent 57756f016e
commit 466f710b33
6 changed files with 11 additions and 4 deletions

View File

@@ -260,6 +260,11 @@ const doLogin = () => {
const onLoginSuccess = (res) => {
if (res.code === 200 && res.data) {
// 换号登录时清除旧用户首页缓存,防止新用户看到旧用户的小区数据
const oldUserId = uni.getStorageSync('userId')
if (res.data.userId && String(oldUserId) !== String(res.data.userId)) {
uni.removeStorageSync('home_cache')
}
uni.setStorageSync('token', res.data.token)
if (res.data.userId) { uni.setStorageSync('userId', res.data.userId) }
const currentVillageId = res.data.currentVillageId || 0