diff --git a/pages/index/my.vue b/pages/index/my.vue index b397c6c..33b7f74 100644 --- a/pages/index/my.vue +++ b/pages/index/my.vue @@ -312,24 +312,19 @@ }, // 退出登录 logout() { - if (!this.isLoggedIn) return - uni.showModal({ title: '提示', content: '确定要退出登录吗?', success: (res) => { if (res.confirm) { - // 清除登录状态 + // 清除本地存储的用户信息 uni.removeStorageSync('token') uni.removeStorageSync('userInfo') - this.isLoggedIn = false - this.userInfo = null - this.barInfo = null - this.myScanData = null + uni.removeStorageSync('barInfo') - // 跳转到登录页 + // 跳转到首页 uni.reLaunch({ - url: '/pages/index/chooseLogin' + url: '/pages/index/index' }) } }