fix: menu item permission

This commit is contained in:
chenos 2022-04-13 12:52:02 +08:00
parent ad2135b4cb
commit e4fffc2245

View File

@ -74,8 +74,10 @@ const InternalAdminLayout = (props: any) => {
<div style={{ width: 200, display: 'inline-flex', color: '#fff', padding: '0', alignItems: 'center' }}> <div style={{ width: 200, display: 'inline-flex', color: '#fff', padding: '0', alignItems: 'center' }}>
<img <img
className={css` className={css`
height: 20px;
padding: 0 16px; padding: 0 16px;
object-fit: contain;
width: 100%;
height: 100%;
`} `}
src={result?.data?.data?.logo?.url} src={result?.data?.data?.logo?.url}
/> />
@ -96,20 +98,20 @@ const InternalAdminLayout = (props: any) => {
} }
data['x-component-props'] = data['x-component-props'] || {}; data['x-component-props'] = data['x-component-props'] || {};
data['x-component-props']['defaultSelectedUid'] = defaultSelectedUid; data['x-component-props']['defaultSelectedUid'] = defaultSelectedUid;
filterByACL(data, ctx); return filterByACL(data, ctx);
return data;
}} }}
onSuccess={(data) => { onSuccess={(data) => {
const schema = filterByACL(data?.data, ctx);
if (defaultSelectedUid) { if (defaultSelectedUid) {
const s = findByUid(data?.data, defaultSelectedUid); const s = findByUid(schema, defaultSelectedUid);
if (s) { if (s) {
setTitle(s.title); setTitle(s.title);
return;
} }
return;
} }
setHidden(true); setHidden(true);
setTimeout(() => setHidden(false), 11); setTimeout(() => setHidden(false), 11);
const s = findMenuItem(data?.data); const s = findMenuItem(schema);
if (s) { if (s) {
setSchema(s); setSchema(s);
setTitle(s.title); setTitle(s.title);