Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TF-MOM-WEB
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TFMOM
TF-MOM-WEB
Commits
c345fdcd
Commit
c345fdcd
authored
Sep 27, 2024
by
jingnan
👀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
同一账号连续登录时缓存历史页签数据
parent
0eb7a711
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
user.js
applications/architecture-dee/src/store/modules/user.js
+2
-0
index.vue
applications/architecture-dee/src/views/login/index.vue
+6
-1
No files found.
applications/architecture-dee/src/store/modules/user.js
View file @
c345fdcd
...
...
@@ -166,6 +166,8 @@ const actions = {
return
new
Promise
((
resolve
,
reject
)
=>
{
// resetRouter() 考虑退出后 重新登录 不清路由
logout
({
token
:
localStorage
.
getItem
(
'token'
)
},
!!
flag
).
then
(
response
=>
{
// 将当前登录用户的id保存到本地,下次登录时,判断是否为同一个用户,如果不是,则不用缓存历史页签
localStorage
.
setItem
(
'previousUserId'
,
localStorage
.
getItem
(
'userId'
))
removeToken
()
commit
(
'SET_TOKEN'
,
''
)
console
.
log
(
'退出成功'
)
...
...
applications/architecture-dee/src/views/login/index.vue
View file @
c345fdcd
...
...
@@ -194,7 +194,12 @@ export default {
}
else
{
localStorage
.
removeItem
(
'loginInfo'
)
}
this
.
$store
.
dispatch
(
'tagsView/delAllVisitedViews'
,
params
)
// 判断上次登录用户与此次是否一致,不一致则清除上次历史页签
const
previousUserId
=
localStorage
.
getItem
(
'previousUserId'
)
const
userId
=
localStorage
.
getItem
(
'userId'
)
if
(
previousUserId
&&
previousUserId
!==
userId
)
{
this
.
$store
.
dispatch
(
'tagsView/delAllVisitedViews'
,
params
)
}
this
.
$store
.
dispatch
(
'tagsView/delAllCachedViews'
,
params
)
this
.
$store
.
dispatch
(
'permission/clearPermissionList'
)
// this.$router.push({ path: this.redirect || '/' })
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment