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
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
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 @
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