Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
work-order-web
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
张圳龙
work-order-web
Commits
e1c2c715
Unverified
Commit
e1c2c715
authored
Mar 26, 2021
by
lanyulei
Committed by
GitHub
Mar 26, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #59 from lanyulei/dev
fix: 修复循环获取用户信息的bug, fix #150
parents
bf356892
c637236e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
user.js
src/store/modules/user.js
+4
-2
request.js
src/utils/request.js
+2
-7
No files found.
src/store/modules/user.js
View file @
e1c2c715
...
...
@@ -78,8 +78,10 @@ const actions = {
commit
(
'SET_AVATAR'
,
avatar
)
commit
(
'SET_INTRODUCTION'
,
introduction
)
resolve
(
response
)
}).
catch
(
error
=>
{
reject
(
error
)
}).
catch
(()
=>
{
commit
(
'SET_TOKEN'
,
''
)
setToken
(
''
)
router
.
push
({
path
:
'/'
})
})
})
},
...
...
src/utils/request.js
View file @
e1c2c715
import
axios
from
'axios'
import
{
Notification
,
MessageBox
,
Message
}
from
'element-ui'
import
{
MessageBox
,
Message
}
from
'element-ui'
import
store
from
'@/store'
import
{
getToken
}
from
'@/utils/auth'
...
...
@@ -74,18 +74,13 @@ service.interceptors.response.use(
location
.
reload
()
// 为了重新实例化vue-router对象 避免bug
})
return
false
}
else
if
(
code
===
400
||
code
===
403
)
{
}
else
if
(
code
===
400
||
code
===
403
||
code
!==
200
)
{
Message
({
message
:
response
.
data
.
msg
,
type
:
'error'
,
duration
:
5
*
1000
})
return
Promise
.
reject
(
'error'
)
}
else
if
(
code
!==
200
)
{
Notification
.
error
({
title
:
response
.
data
.
msg
})
return
Promise
.
reject
(
'error'
)
}
else
{
return
response
.
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