fix layout menu

This commit is contained in:
rizky 2024-07-23 21:36:35 -07:00
parent 3e09e4b0dd
commit 3034a12ded
2 changed files with 5 additions and 3 deletions

View File

@ -139,11 +139,12 @@ export const Layout: FC<LYTChild> = (props) => {
if (!w.user) {
local.loading = true;
loadSession(props.login_url || "/auth/login");
console.log(w.user);
}
}
if (path === props.login_url) return props.blank_layout;
if (!w.user && !isEditor)
if (!w.user && !isEditor) {
return (
<div
className={cx(
@ -153,6 +154,9 @@ export const Layout: FC<LYTChild> = (props) => {
<FieldLoading />
</div>
);
} else {
local.loading = false;
}
return (
<props.PassProp

View File

@ -21,7 +21,6 @@ type MLocal = typeof local_default & { render: () => void };
export const Menu: FC<MenuProp> = (props) => {
const imenu = props.menu;
console.log({imenu})
let role = props.role;
role = props.on_init();
let menu = get(imenu, role) || [];
@ -82,7 +81,6 @@ export const SideBar: FC<{
pm
}
const data: IMenu[] = (typeof _data[0] === "string" ? [_data] : _data) as any;
console.log({data})
useEffect(() => {
data.map((item) => {
const menu = {