mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-25 17:42:25 +01:00
细化登录错误信息
This commit is contained in:
@@ -33,16 +33,19 @@ const request = (method, path, params, data, others = {}) => {
|
||||
return Promise.reject(response)
|
||||
}).catch((e) => {
|
||||
let response = e.response
|
||||
if (!response) {
|
||||
return e
|
||||
}
|
||||
if (response.status === 400) {
|
||||
Message.error(response.data.error)
|
||||
}
|
||||
if (response.status === 401 && router.currentRoute.path !== '/login') {
|
||||
console.log('login')
|
||||
router.push('/login')
|
||||
}
|
||||
if (response.status === 500) {
|
||||
Message.error(response.data.error)
|
||||
}
|
||||
return e
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user