修改显示小区bug

This commit is contained in:
zhouyanli
2026-06-04 17:01:28 +08:00
parent ade0d2d547
commit 2ba24f2320
4 changed files with 9 additions and 2 deletions

View File

@@ -224,6 +224,8 @@ const handleLogin = () => {
if (res.data.userId) {
uni.setStorageSync('userId', res.data.userId)
}
// 清掉上次账号的小区缓存,防止新账号显示旧小区
uni.removeStorageSync('currentVillage')
// 存当前绑定的小区ID,0 表示未绑定
const currentVillageId = res.data.currentVillageId || 0
uni.setStorageSync('currentVillageId', currentVillageId)

View File

@@ -161,6 +161,8 @@
// console.log('33333',res)
if(res.code === 200){
uni.setStorageSync('token', res.data.token);
// 清掉上次账号的小区缓存,防止新账号显示旧小区
uni.removeStorageSync('currentVillage');
// 存用户ID
// if(res.data) {
// // 存当前绑定的小区ID,0 表示未绑定

View File

@@ -29,7 +29,7 @@
<!-- 退出登录按钮 -->
<view class="logout-btn-wrap">
<button class="logout-btn" :disabled="!phoneNumber" @tap="handleLogout">
<button class="logout-btn" @tap="handleLogout">
退出登录
</button>
</view>