mirror of
https://github.com/labring/FastGPT.git
synced 2026-01-14 06:03:34 +08:00
add 10-minute auto-refresh for token login (#5788)
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user