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
d9df4caf
Commit
d9df4caf
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
77904113
c891a12f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
13 deletions
+11
-13
LayoutSide.vue
src/components/layout/LayoutSide.vue
+0
-3
index.js
src/router/index.js
+8
-5
app.js
src/store/modules/app.js
+2
-2
user.js
src/store/modules/user.js
+1
-3
No files found.
src/components/layout/LayoutSide.vue
View file @
d9df4caf
...
...
@@ -27,8 +27,6 @@ export default {
},
data
()
{
return
{
current
:
0
,
routerList
:
[],
collapsed
:
false
,
menuList
:
[],
openKeys
:
[],
...
...
@@ -83,7 +81,6 @@ export default {
if
(
value
)
{
this
.
menuList
=
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'menuList'
))
this
.
openKeys
=
[
this
.
menuList
[
0
].
id
]
this
.
$store
.
commit
(
'app/setOpenKeys'
,
this
.
menuList
[
0
].
id
)
}
}
}
...
...
src/router/index.js
View file @
d9df4caf
...
...
@@ -317,12 +317,16 @@ export function changeSystemType (type) {
try
{
this
.
$store
.
commit
(
'app/clearStore'
)
setType
(
type
+
''
)
this
.
$store
.
commit
(
'app/setsystemType'
,
type
)
let
menuList
=
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'menuList'
))
this
.
$store
.
commit
(
'app/initStore'
,
[
menuList
[
0
].
id
])
await
store
.
dispatch
(
'user/getMenuList'
)
this
.
$store
.
commit
(
'app/setSystemType'
,
type
)
this
.
$router
.
push
(
'/'
)
resolve
(
true
)
}
catch
(
e
)
{
this
.
$api
.
base
.
logout
().
then
(({
data
})
=>
{
}).
catch
(()
=>
{
})
removeToken
()
window
.
sessionStorage
.
clear
();
this
.
$store
.
commit
(
'app/clearStore'
)
this
.
$router
.
push
(
`/login`
)
reject
(
false
)
}
})
...
...
@@ -341,8 +345,7 @@ router.beforeEach(async (to, from, next) => {
NProgress
.
done
()
}
else
{
const
hasUser
=
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'user'
))
const
hasMenu
=
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'menuList'
))
if
(
hasUser
&&
hasMenu
)
{
if
(
hasUser
)
{
if
(
hasUser
.
type
===
'3'
&&
!!!
hasUser
.
systemType
&&
hasUser
.
roles
!=
'4'
)
{
if
(
to
.
path
===
'/sys'
)
{
next
()
...
...
src/store/modules/app.js
View file @
d9df4caf
...
...
@@ -18,7 +18,7 @@ const mutations = {
setTabsArray
:
(
state
,
payload
)
=>
{
state
.
tabsArray
=
payload
},
set
s
ystemType
:
(
state
,
payload
)
=>
{
set
S
ystemType
:
(
state
,
payload
)
=>
{
state
.
systemType
=
payload
},
addTabs
:
(
state
,
payload
)
=>
{
...
...
@@ -142,7 +142,7 @@ const mutations = {
this
.
commit
(
'app/setTabsArray'
,
[])
this
.
commit
(
'app/setTabsActive'
,
''
)
this
.
commit
(
'app/setCachedViews'
,
[])
this
.
commit
(
'app/set
s
ystemType'
,
null
)
this
.
commit
(
'app/set
S
ystemType'
,
null
)
},
}
...
...
src/store/modules/user.js
View file @
d9df4caf
...
...
@@ -19,8 +19,6 @@ const actions = {
if
(
data
)
{
try
{
window
.
sessionStorage
.
setItem
(
'user'
,
JSON
.
stringify
(
data
.
userInfo
))
window
.
sessionStorage
.
setItem
(
'menuList'
,
JSON
.
stringify
(
data
.
menuList
))
this
.
commit
(
'app/initStore'
,
[
data
.
menuList
[
0
].
id
])
resolve
(
data
)
}
catch
(
error
)
{
reject
(
error
)
...
...
@@ -35,7 +33,7 @@ const actions = {
},
getMenuList
({
dispatch
})
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
await
api
.
base
.
getMenuList
().
then
(({
data
=
{}
})
=>
{
await
api
.
base
.
getMenuList
(
{
systemType
:
getType
()
}
).
then
(({
data
=
{}
})
=>
{
if
(
data
)
{
try
{
window
.
sessionStorage
.
setItem
(
'menuList'
,
JSON
.
stringify
(
data
))
...
...
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