fix(user): 解决切换账户时标签页状态残留问题
- 导入 tagsView 模块以管理标签页状态 - 在用户登出时清除标签页内存状态 - 添加异常处理避免标签页清理失败影响登出流程 - 修复切换账户时页面标签残留的安全风险 - 在检查清单文档开头添加空行以符合格式规范
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
|
||||
# 前端发布前检查清单
|
||||
|
||||
> **文档类型**: 技术规范
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {getInfo, login, logout} from '@/api/login'
|
||||
import useTagsViewStore from '@/store/modules/tagsView'
|
||||
import {getToken, removeToken, setToken} from '@/utils/auth'
|
||||
import defAva from '@/assets/images/user.png'
|
||||
import {defineStore} from 'pinia'
|
||||
@@ -84,6 +85,8 @@ const useUserStore = defineStore(
|
||||
this.permissions = []
|
||||
this.tenantId = ''
|
||||
removeToken()
|
||||
// 清除标签页内存状态,防止切换账户时残留
|
||||
try { useTagsViewStore().delAllViews() } catch(e) {}
|
||||
resolve()
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
|
||||
Reference in New Issue
Block a user