diff --git a/preset/menu/Layout.tsx b/preset/menu/Layout.tsx index 3a45033..ba3f0e0 100755 --- a/preset/menu/Layout.tsx +++ b/preset/menu/Layout.tsx @@ -2,9 +2,10 @@ import { getPathname } from "lib/utils/pathname"; import { FC, ReactNode, useEffect, useLayoutEffect, useState } from "react"; import { loadSession } from "../login/utils/load"; import { useLocal } from "lib/utils/use-local"; +import { FieldLoading } from "lib/exports"; const w = window as any; -const fn = function () { +const initResponsive = function () { const mode = localStorage.getItem("prasi-editor-mode"); if (isEditor) { setTimeout(() => { @@ -62,11 +63,14 @@ export const Layout: FC = (props) => { } }, []); - fn(); + initResponsive(); const path = getPathname(); const no_layout = props.exception; - if (!w.user) loadSession(props.login_url || "/auth/login"); + if (!w.user) { + local.loading = true; + loadSession(props.login_url || "/auth/login"); + } if (!isEditor && Array.isArray(no_layout)) { if (no_layout.length) { @@ -77,7 +81,12 @@ export const Layout: FC = (props) => { } if (path === props.login_url) return props.blank_layout; - if (!w.user && !isEditor) return props.blank_layout; + if (!w.user && !isEditor) + return ( +
+ +
+ ); return (