add 10-minute auto-refresh for token login (#5788)
Some checks are pending
Build FastGPT images in Personal warehouse / get-vars (push) Waiting to run
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:amd64 runs-on:ubuntu-24.04]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / build-fastgpt-images (map[arch:arm64 runs-on:ubuntu-24.04-arm]) (push) Blocked by required conditions
Build FastGPT images in Personal warehouse / release-fastgpt-images (push) Blocked by required conditions

This commit is contained in:
heheer 2025-10-20 14:44:49 +08:00 committed by GitHub
parent 2d0a956e60
commit 703ef2cd56
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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(