使用真登录功能前拉取报错,提交代码

This commit is contained in:
GYYM
2024-11-20 11:22:05 +08:00
parent 963c0f5713
commit fdc7639887
19 changed files with 192 additions and 86 deletions

View File

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