Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Chatopera OpenSource
/
ferry_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c637236e
authored
Mar 26, 2021
by
YuleiLan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复循环获取用户信息的bug, fix #150
parent
888b6bfc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
src/store/modules/user.js
src/utils/request.js
src/store/modules/user.js
View file @
c637236e
...
...
@@ -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 @
c637236e
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