fix: 退出登录时保留deviceId
- logout时先保存deviceId,清除缓存后恢复 - 确保同一设备退出登录后再次登录不会创建新用户
This commit is contained in:
1 parent
6574279fce
commit
25036a7761
1 file changed
+4
@@ -135,7 +135,11 @@ export default {
|
||||
content: '确定要退出登录吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
const deviceId = uni.getStorageSync('deviceId')
|
||||
uni.clearStorageSync()
|
||||
if (deviceId) {
|
||||
uni.setStorageSync('deviceId', deviceId)
|
||||
}
|
||||
uni.setStorageSync('isLoggedIn', false)
|
||||
uni.showToast({
|
||||
title: '已退出登录',
|
||||
|
||||
Reference in new issue
Block a user