Commit 703ef2cd by heheer Committed by GitHub

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

parent 2d0a956e
...@@ -26,13 +26,14 @@ const Auth = ({ children }: { children: JSX.Element | React.ReactNode }) => { ...@@ -26,13 +26,14 @@ const Auth = ({ children }: { children: JSX.Element | React.ReactNode }) => {
useQuery( useQuery(
[router.pathname], [router.pathname],
() => { () => {
if (unAuthPage[router.pathname] === true || userInfo) { if (unAuthPage[router.pathname] === true) {
return null; return null;
} else { } else {
return initUserInfo(); return initUserInfo();
} }
}, },
{ {
refetchInterval: 10 * 60 * 1000,
onError(error) { onError(error) {
console.log('error->', error); console.log('error->', error);
router.replace( router.replace(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment