fix: 修改退出登录后的跳转逻辑,改为跳转到首页
This commit is contained in:
parent
a3d7f3002c
commit
ae35d60f12
@ -312,24 +312,19 @@
|
|||||||
},
|
},
|
||||||
// 退出登录
|
// 退出登录
|
||||||
logout() {
|
logout() {
|
||||||
if (!this.isLoggedIn) return
|
|
||||||
|
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '确定要退出登录吗?',
|
content: '确定要退出登录吗?',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
// 清除登录状态
|
// 清除本地存储的用户信息
|
||||||
uni.removeStorageSync('token')
|
uni.removeStorageSync('token')
|
||||||
uni.removeStorageSync('userInfo')
|
uni.removeStorageSync('userInfo')
|
||||||
this.isLoggedIn = false
|
uni.removeStorageSync('barInfo')
|
||||||
this.userInfo = null
|
|
||||||
this.barInfo = null
|
|
||||||
this.myScanData = null
|
|
||||||
|
|
||||||
// 跳转到登录页
|
// 跳转到首页
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/index/chooseLogin'
|
url: '/pages/index/index'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user