Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
Y
yn-science-front
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
徐俊
yn-science-front
Commits
3551c2a7
Commit
3551c2a7
authored
Jul 23, 2025
by
wangxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
33
parent
bd2a02e7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
index.js
src/router/index.js
+2
-7
user.js
src/store/modules/user.js
+11
-1
No files found.
src/router/index.js
View file @
3551c2a7
...
@@ -317,17 +317,12 @@ export function changeSystemType (type) {
...
@@ -317,17 +317,12 @@ export function changeSystemType (type) {
try
{
try
{
this
.
$store
.
commit
(
'app/clearStore'
)
this
.
$store
.
commit
(
'app/clearStore'
)
setType
(
type
+
''
)
setType
(
type
+
''
)
await
store
.
dispatch
(
'user/
getMenuLis
t'
)
await
store
.
dispatch
(
'user/
logou
t'
)
this
.
$store
.
commit
(
'app/setSystemType'
,
type
)
this
.
$store
.
commit
(
'app/setSystemType'
,
type
)
this
.
$router
.
push
(
'/'
)
this
.
$router
.
push
(
'/'
)
resolve
(
true
)
resolve
(
true
)
}
catch
(
e
)
{
}
catch
(
e
)
{
this
.
$api
.
base
.
logout
().
then
(({
data
})
=>
{
}).
catch
(()
=>
{
})
store
.
dispatch
(
'user/logout'
)
removeToken
()
window
.
sessionStorage
.
clear
();
this
.
$store
.
commit
(
'app/clearStore'
)
this
.
$router
.
push
(
`/login`
)
reject
(
false
)
}
}
})
})
}
}
...
...
src/store/modules/user.js
View file @
3551c2a7
// @ts-nocheck
// @ts-nocheck
import
router
from
'@/router'
import
router
from
'@/router'
import
api
from
'@/api'
import
api
from
'@/api'
import
{
getType
}
from
'@/views/utils/auth'
import
{
getT
oken
,
removeToken
,
getType
,
setT
ype
}
from
'@/views/utils/auth'
const
state
=
{
const
state
=
{
...
@@ -50,6 +50,16 @@ const actions = {
...
@@ -50,6 +50,16 @@ const actions = {
})
})
})
})
},
},
logout
({
dispatch
})
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
this
.
$message
.
error
(
'登录信息失效,请重新登录!'
)
this
.
$api
.
base
.
logout
().
then
(({
data
})
=>
{
}).
catch
(()
=>
{
})
removeToken
()
window
.
sessionStorage
.
clear
()
this
.
$store
.
commit
(
'app/clearStore'
)
this
.
$router
.
push
(
`/login`
)
})
},
}
}
...
...
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