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
c5f18317
Commit
c5f18317
authored
Dec 04, 2024
by
wangxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
22
parent
4f6354fd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
index.js
src/router/index.js
+1
-1
user.js
src/store/modules/user.js
+4
-2
No files found.
src/router/index.js
View file @
c5f18317
...
@@ -293,7 +293,7 @@ export function changeProjType (type) {
...
@@ -293,7 +293,7 @@ export function changeProjType (type) {
new
Promise
(
async
(
resolve
,
reject
)
=>
{
new
Promise
(
async
(
resolve
,
reject
)
=>
{
try
{
try
{
this
.
$store
.
commit
(
'app/clearStore'
)
this
.
$store
.
commit
(
'app/clearStore'
)
setType
(
type
+
''
)
setType
(
type
)
this
.
$store
.
commit
(
'app/setProjType'
,
type
)
this
.
$store
.
commit
(
'app/setProjType'
,
type
)
let
menuList
=
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'menuList'
))
let
menuList
=
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'menuList'
))
this
.
$store
.
commit
(
'app/initStore'
,
[
menuList
[
0
].
id
])
this
.
$store
.
commit
(
'app/initStore'
,
[
menuList
[
0
].
id
])
...
...
src/store/modules/user.js
View file @
c5f18317
// @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
{
getType
,
setType
}
from
'@/views/utils/auth'
const
state
=
{
const
state
=
{
...
@@ -18,8 +18,10 @@ const actions = {
...
@@ -18,8 +18,10 @@ const actions = {
await
api
.
base
.
getUser
().
then
(({
data
=
{}
})
=>
{
await
api
.
base
.
getUser
().
then
(({
data
=
{}
})
=>
{
if
(
data
)
{
if
(
data
)
{
try
{
try
{
window
.
sessionStorage
.
setItem
(
'user'
,
JSON
.
stringify
(
data
.
userInfo
))
window
.
sessionStorage
.
setItem
(
'user'
,
JSON
.
stringify
(
data
.
userInfo
))
window
.
sessionStorage
.
setItem
(
'menuList'
,
JSON
.
stringify
(
data
.
menuList
))
window
.
sessionStorage
.
setItem
(
'menuList'
,
JSON
.
stringify
(
data
.
menuList
))
setType
(
hasUser
.
type
)
this
.
commit
(
'app/setProjType'
,
hasUser
.
type
)
this
.
commit
(
'app/setComplete'
,
data
.
complete
)
this
.
commit
(
'app/setComplete'
,
data
.
complete
)
this
.
commit
(
'app/initStore'
,
[
data
.
menuList
[
0
].
id
])
this
.
commit
(
'app/initStore'
,
[
data
.
menuList
[
0
].
id
])
resolve
(
data
)
resolve
(
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