diff --git a/src/pages/componentDevelopment/componentList/index.tsx b/src/pages/componentDevelopment/componentList/index.tsx index 9ce94ed..8de594d 100644 --- a/src/pages/componentDevelopment/componentList/index.tsx +++ b/src/pages/componentDevelopment/componentList/index.tsx @@ -76,8 +76,7 @@ const GlobalVarContainer = () => { // 获取用户信息,判断是否为超管 const userInfo = useSelector((state: any) => state.user?.userInfo); - // TODO: 等后端提供角色标识字段后,替换这里的判断逻辑 - const isAdmin = userInfo?.role === 'admin' || userInfo?.isAdmin === true; + const isAdmin = userInfo?.isAdmin === true; const menuItems = [ { @@ -92,12 +91,13 @@ const GlobalVarContainer = () => { icon: '/ideContainer/icon/teamComp.png', activeIcon: '/ideContainer/icon/teamComp_active.png' }, - { + // 只有超管才显示组件审核菜单 + ...(isAdmin ? [{ key: '3', label: '组件审核', icon: '/ideContainer/icon/compAudit.png', activeIcon: '/ideContainer/icon/compAudit_active.png' - } + }] : []) ]; const columns = [