财务管理菜单只对超级管理员开放
This commit is contained in:
parent
6c6fd1cc9f
commit
9ff71f499a
@ -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) {}
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user