From e14b74fe33e65e87e3c5b4d6ae78866b6fe327e6 Mon Sep 17 00:00:00 2001 From: ZLY Date: Fri, 16 Jan 2026 17:08:35 +0800 Subject: [PATCH] =?UTF-8?q?pref(componentList):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E6=9D=83=E9=99=90=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/componentDevelopment/componentList/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 = [