fix: refreshToken

pull/2/head
xingyu4j 2022-11-17 13:45:09 +08:00
parent e175486692
commit 34d8954469
1 changed files with 2 additions and 0 deletions

View File

@ -129,6 +129,7 @@ service.interceptors.response.use(
isRefreshToken = true
// 1. 如果获取不到刷新令牌,则只能执行登出操作
if (!getRefreshToken()) {
console.info(getRefreshToken())
return handleAuthorized()
}
// 2. 进行刷新访问令牌
@ -206,6 +207,7 @@ service.interceptors.response.use(
)
const refreshToken = async () => {
axios.defaults.headers.common['tenant-id'] = getTenantId()
return await axios.post(base_url + '/system/auth/refresh-token?refreshToken=' + getRefreshToken())
}
const handleAuthorized = () => {