修复bug

This commit is contained in:
zhouyanli
2026-08-11 14:52:25 +08:00
parent 3757033744
commit 839f3ee1b7
6 changed files with 56 additions and 23 deletions

View File

@@ -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' })
}