fix: axios response超时逻辑变更

This commit is contained in:
chenjinsong
2023-08-25 16:23:18 +08:00
parent 26352f1b9c
commit dc6b8e067c
13 changed files with 38 additions and 31 deletions

View File

@@ -69,6 +69,13 @@ axios.interceptors.response.use(
return response
},
error => {
if (licenceErrorCode.indexOf(error.response.data.code) !== -1) {
localStorage.removeItem(storageKey.token)
window.location.href = '/'
} else if (accountErrorCode.indexOf(error.response.data.code) !== -1) {
localStorage.removeItem(storageKey.token)
window.location.href = '/'
}
return Promise.reject(error)
}
)