使用真登录功能前拉取报错,提交代码
This commit is contained in:
@@ -42,7 +42,7 @@ class RequestHttp {
|
||||
config.loading ?? (config.loading = true)
|
||||
config.loading && showFullScreenLoading()
|
||||
if (config.headers && typeof config.headers.set === 'function') {
|
||||
config.headers.set('x-access-token', userStore.token)
|
||||
config.headers.set('Authorization', 'Bearer '+userStore.token)
|
||||
}
|
||||
return config
|
||||
},
|
||||
@@ -63,6 +63,7 @@ class RequestHttp {
|
||||
// 登陆失效
|
||||
if (data.code == ResultEnum.OVERDUE) {
|
||||
userStore.setToken('')
|
||||
userStore.setUserInfo({name: ''})
|
||||
router.replace(LOGIN_URL)
|
||||
ElMessage.error(data.message)
|
||||
return Promise.reject(data)
|
||||
|
||||
Reference in New Issue
Block a user