perf: 懒加载和动态加载优化
This commit is contained in:
@@ -25,10 +25,10 @@ const Auth = ({ children }: { children: JSX.Element }) => {
|
||||
useQuery(
|
||||
[router.pathname, userInfo],
|
||||
() => {
|
||||
setLoading(true);
|
||||
if (unAuthPage[router.pathname] === true || userInfo) {
|
||||
return setLoading(false);
|
||||
} else {
|
||||
setLoading(true);
|
||||
return getTokenLogin();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -43,15 +43,13 @@ const navbarList = [
|
||||
const Layout = ({ children }: { children: JSX.Element }) => {
|
||||
const { isPc } = useScreen();
|
||||
const router = useRouter();
|
||||
const { Loading } = useLoading({
|
||||
defaultLoading: true
|
||||
});
|
||||
const { Loading } = useLoading({ defaultLoading: true });
|
||||
const { loading } = useGlobalStore();
|
||||
|
||||
return (
|
||||
<>
|
||||
{!unShowLayoutRoute[router.pathname] ? (
|
||||
<Box data-test="ss" h={'100%'} backgroundColor={'gray.100'} overflow={'auto'}>
|
||||
<Box h={'100%'} backgroundColor={'gray.100'} overflow={'auto'}>
|
||||
{isPc ? (
|
||||
<>
|
||||
<Box h={'100%'} position={'fixed'} left={0} top={0} w={'80px'}>
|
||||
|
||||
Reference in New Issue
Block a user