add 10-minute auto-refresh for token login (#5788)

This commit is contained in:
heheer
2025-10-20 14:44:49 +08:00
committed by GitHub
parent 2d0a956e60
commit 703ef2cd56

View File

@@ -26,13 +26,14 @@ const Auth = ({ children }: { children: JSX.Element | React.ReactNode }) => {
useQuery(
[router.pathname],
() => {
if (unAuthPage[router.pathname] === true || userInfo) {
if (unAuthPage[router.pathname] === true) {
return null;
} else {
return initUserInfo();
}
},
{
refetchInterval: 10 * 60 * 1000,
onError(error) {
console.log('error->', error);
router.replace(