修复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
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
}
|
||||
|
||||
const goBack = () => {
|
||||
uni.switchTab({ url: '/pages/myIndex/myIndex' })
|
||||
uni.navigateBack({ delta: 1 })
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
}
|
||||
|
||||
const goBack = () => {
|
||||
uni.switchTab({ url: '/pages/myIndex/myIndex' })
|
||||
uni.navigateBack({ delta: 1 })
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
}
|
||||
|
||||
const goBack = () => {
|
||||
uni.switchTab({ url: '/pages/myIndex/myIndex' })
|
||||
uni.navigateBack({ delta: 1 })
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -293,6 +293,7 @@
|
||||
uni.removeStorageSync('token')
|
||||
uni.removeStorageSync('userId')
|
||||
uni.removeStorageSync('currentVillageId')
|
||||
uni.removeStorageSync('home_cache')
|
||||
uni.hideLoading()
|
||||
uni.hideToast()
|
||||
uni.reLaunch({ url: '/pageSubPack/loginSub/login?mode=pwd' })
|
||||
|
||||
@@ -346,13 +346,14 @@
|
||||
}
|
||||
|
||||
const resetPageData = () => {
|
||||
currentCommunity.value = '请先绑定房屋'
|
||||
currentCommunity.value = '请绑定房屋'
|
||||
currentVillageId.value = ''
|
||||
activityList.value = []
|
||||
bannerList.value = []
|
||||
bannerRawData.value = []
|
||||
noticeText.value = '暂无公告'
|
||||
noticeId.value = ''
|
||||
uni.removeStorageSync(HOME_CACHE_KEY)
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
|
||||
Reference in New Issue
Block a user