From e4fffc22451e255deb5b0c1b36adf8a9e91391bd Mon Sep 17 00:00:00 2001 From: chenos Date: Wed, 13 Apr 2022 12:52:02 +0800 Subject: [PATCH] fix: menu item permission --- .../src/route-switch/antd/admin-layout/index.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/client/src/route-switch/antd/admin-layout/index.tsx b/packages/client/src/route-switch/antd/admin-layout/index.tsx index f5372ab87..3471e3fee 100644 --- a/packages/client/src/route-switch/antd/admin-layout/index.tsx +++ b/packages/client/src/route-switch/antd/admin-layout/index.tsx @@ -74,8 +74,10 @@ const InternalAdminLayout = (props: any) => {
@@ -96,20 +98,20 @@ const InternalAdminLayout = (props: any) => { } data['x-component-props'] = data['x-component-props'] || {}; data['x-component-props']['defaultSelectedUid'] = defaultSelectedUid; - filterByACL(data, ctx); - return data; + return filterByACL(data, ctx); }} onSuccess={(data) => { + const schema = filterByACL(data?.data, ctx); if (defaultSelectedUid) { - const s = findByUid(data?.data, defaultSelectedUid); + const s = findByUid(schema, defaultSelectedUid); if (s) { setTitle(s.title); + return; } - return; } setHidden(true); setTimeout(() => setHidden(false), 11); - const s = findMenuItem(data?.data); + const s = findMenuItem(schema); if (s) { setSchema(s); setTitle(s.title);