修复bug
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
import { ref } from 'vue'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { logout, getSettingInfo } from '../../api/api.js'
|
||||
import { clearAccountStorage } from '../../api/request.js'
|
||||
import { usePermStore } from '@/stores/usePermStore'
|
||||
|
||||
const permStore = usePermStore()
|
||||
@@ -121,9 +122,10 @@ const confirmLogout = () => {
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
permStore.clearPerm()
|
||||
uni.clearStorageSync()
|
||||
clearAccountStorage()
|
||||
uni.showToast({ title: '退出登录成功', icon: 'success' })
|
||||
uni.redirectTo({ url: '/pageSubPack/loginSub/pwd-login' })
|
||||
// 使用 reLaunch 销毁所有页面(包括 tab 页),确保新账号登录后页面重新初始化
|
||||
uni.reLaunch({ url: '/pageSubPack/loginSub/pwd-login' })
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || '退出失败', icon: 'none' })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user