mirror of
https://github.com/whyour/qinglong.git
synced 2026-10-17 07:20:51 +08:00
fix: prevent expired-token login refresh loop
This commit is contained in:
@@ -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