mirror of
https://github.com/whyour/qinglong.git
synced 2026-12-01 09:45:36 +08:00
fix: prevent expired-token login refresh loop
This commit is contained in:
1 parent
d9833c17d5
commit
6acb665369
3 files changed
+158
-9
No files matched your search
@@ -114,13 +114,9 @@ export default function () {
|
||||
history.push('/error');
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
const responseStatus = error.response.status;
|
||||
if (responseStatus !== 401) {
|
||||
history.push('/error');
|
||||
} else {
|
||||
window.location.reload();
|
||||
}
|
||||
.catch(() => {
|
||||
// Health is anonymous; a failure must not trigger a page reload loop.
|
||||
history.push('/error');
|
||||
})
|
||||
.finally(() => setInitLoading(false));
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user