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