This commit is contained in:
Zy
2026-06-10 09:18:22 +08:00
3 changed files with 21 additions and 7 deletions

View File

@@ -221,8 +221,8 @@ const handleLogin = () => {
if (res.data) {
uni.setStorageSync('token', res.data.token)
// 存用户ID
if (res.data.userId) {
uni.setStorageSync('userId', res.data.userId)
if (res.data.user.userId) {
uni.setStorageSync('userId', res.data.user.userId)
}
// 清掉上次账号的小区缓存,防止新账号显示旧小区
uni.removeStorageSync('currentVillage')

View File

@@ -118,6 +118,7 @@
switchVillage({ villageId: selectedItem.value.id }).then((res) =>{
if(res.code === 200){
uni.showToast({ title: '切换成功', icon: 'success', duration: 1500 })
uni.hideLoading()
uni.$emit('confirm', selectedItem.value)
setTimeout(() => {
uni.navigateBack()