修复bug
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user