修复bug

This commit is contained in:
zhouyanli
2026-08-11 14:52:25 +08:00
parent 3757033744
commit 839f3ee1b7
6 changed files with 56 additions and 23 deletions

View File

@@ -99,6 +99,7 @@
<script setup>
import { ref, computed, onUnmounted } from 'vue'
import { getLoginBySms, getSendCode } from '../../api/api.js'
import { clearAccountStorage } from '../../api/request.js'
import PrivacyPopup from '@/components/privacy-popup/privacy-popup.vue'
import { usePermStore } from '@/stores/usePermStore'
@@ -249,6 +250,8 @@ const handleLogin = () => {
cid: push_cid
}
permStore.clearPerm()
// 清除上个账号的所有缓存,防止新账号显示旧数据
clearAccountStorage()
getLoginBySms(params)
.then(res => {
if (res.code === 200) {
@@ -259,8 +262,6 @@ const handleLogin = () => {
if (res.data.user.userId) {
uni.setStorageSync('userId', res.data.user.userId)
}
// 清掉上次账号的小区缓存,防止新账号显示旧小区
uni.removeStorageSync('currentVillage')
// 存当前绑定的小区ID,0 表示未绑定
const currentVillageId = res.data.currentVillageId || 0
uni.setStorageSync('currentVillageId', currentVillageId)