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
527c81f9
Commit
527c81f9
authored
Jul 23, 2025
by
徐俊
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.yiboshi.com/XuJun/yn-science-front
parents
26d95036
bac0cea6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
7 deletions
+18
-7
index.js
src/router/index.js
+1
-6
app.js
src/store/modules/app.js
+5
-0
user.js
src/store/modules/user.js
+12
-1
No files found.
src/router/index.js
View file @
527c81f9
...
@@ -322,12 +322,7 @@ export function changeSystemType (type) {
...
@@ -322,12 +322,7 @@ export function changeSystemType (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/app.js
View file @
527c81f9
...
@@ -17,6 +17,11 @@ const mutations = {
...
@@ -17,6 +17,11 @@ const mutations = {
},
},
setTabsArray
:
(
state
,
payload
)
=>
{
setTabsArray
:
(
state
,
payload
)
=>
{
state
.
tabsArray
=
payload
state
.
tabsArray
=
payload
if
(
!!
state
.
tabsArray
&&
state
.
tabsArray
.
length
>
0
)
{
if
(
state
.
tabsArray
[
0
].
key
!=
'0'
)
{
state
.
tabsArray
.
unshift
({
title
:
'首页'
,
key
:
'0'
,
code
:
'home'
,
keepAlive
:
1
,
router
:
'/home'
,
closable
:
false
})
}
}
},
},
setSystemType
:
(
state
,
payload
)
=>
{
setSystemType
:
(
state
,
payload
)
=>
{
state
.
systemType
=
payload
state
.
systemType
=
payload
...
...
src/store/modules/user.js
View file @
527c81f9
// @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,17 @@ const actions = {
...
@@ -50,6 +50,17 @@ const actions = {
})
})
})
})
},
},
logout
({
dispatch
})
{
_this
=
this
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