refine: GetUserInfo error message
This commit is contained in:
parent
67c06022e1
commit
94ed283c51
|
@ -33,7 +33,7 @@ router.beforeEach((to, from, next) => {
|
||||||
})
|
})
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
store.dispatch('FedLogOut').then(() => {
|
store.dispatch('FedLogOut').then(() => {
|
||||||
Message.error(err || 'Verification failed, please login again')
|
Message.error(err)
|
||||||
next({ path: '/' })
|
next({ path: '/' })
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -63,8 +63,9 @@ const user = {
|
||||||
GetUserInfo({ commit, state }) {
|
GetUserInfo({ commit, state }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getUserInfo(state.token).then(response => {
|
getUserInfo(state.token).then(response => {
|
||||||
if (!response.data) { // 由于mockjs 不支持自定义状态码只能这样hack
|
// 由于mockjs 不支持自定义状态码只能这样hack
|
||||||
reject('error')
|
if (!response.data) {
|
||||||
|
reject('Verification failed, please login again.')
|
||||||
}
|
}
|
||||||
const data = response.data
|
const data = response.data
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue