From 9ff71f499a755dc20f04912e1e6e840a4613cc9d Mon Sep 17 00:00:00 2001 From: zzh Date: Thu, 14 May 2026 13:19:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E7=AE=A1=E7=90=86=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E5=8F=AA=E5=AF=B9=E8=B6=85=E7=BA=A7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E5=BC=80=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/js/app.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/frontend/js/app.js b/frontend/js/app.js index a77e6d6..9b0bb61 100755 --- a/frontend/js/app.js +++ b/frontend/js/app.js @@ -106,6 +106,16 @@ planMenu.style.display = 'none'; } } + + // 财务管理菜单(仅超级管理员) + const financeMenu = document.querySelector('[data-menu="finance"]'); + if (financeMenu) { + if (user && user.role === 'superadmin') { + financeMenu.style.display = ''; + } else { + financeMenu.style.display = 'none'; + } + } } // 高亮当前活动的导航项 @@ -179,10 +189,14 @@ try { currentUser = await API.me().catch(() => null); if (!currentUser || !currentUser.username) { - // 未登录,重定向到独立登录页面 window.location.href = './login.html'; return; } + // 财务管理仅超级管理员可访问 + if ((path === '#/finance' || path === '/finance') && currentUser.role !== 'superadmin') { + window.location.hash = '#/'; + return; + } } catch(e) {} });