+
, label: user?.username, disabled: true },
+ { type: 'divider' as const },
+ { key: 'changePwd', icon:
, label: '修改密码' },
+ { key: 'logout', icon:
, label: '退出登录', danger: true },
+ ],
+ onClick: ({ key }) => {
+ if (key === 'logout') { logout(); navigate('/login'); }
+ if (key === 'changePwd') { setPwdModal(true); pwdForm.resetFields(); }
+ },
+ }} placement="topRight" arrow>
+
{
+ e.currentTarget.style.background = '#ffffff';
+ e.currentTarget.style.boxShadow = '0 4px 12px rgba(0, 0, 0, 0.08)';
+ }}
+ onMouseLeave={(e) => {
+ e.currentTarget.style.background = 'transparent';
+ e.currentTarget.style.boxShadow = 'none';
+ }}
+ >
+
}
+ style={{
+ background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)',
+ boxShadow: '0 4px 12px rgba(99, 102, 241, 0.3)',
+ }} />
+
+
+ {user?.username}
+
+
+ {isAdminUser ? '管理员' : '普通用户'}
+
+
+
+
+
@@ -307,47 +366,6 @@ const AdminLayout: React.FC = () => {
|| antMenuItems.flatMap(m => m.children || []).find((c: any) => c.key === activeKey)?.label
|| '管理后台'}
- , label: user?.username, disabled: true },
- { type: 'divider' as const },
- { key: 'changePwd', icon: , label: '修改密码' },
- { key: 'logout', icon: , label: '退出登录', danger: true },
- ],
- onClick: ({ key }) => {
- if (key === 'logout') { logout(); navigate('/login'); }
- if (key === 'changePwd') { setPwdModal(true); pwdForm.resetFields(); }
- },
- }} placement="bottomRight" arrow>
- {
- e.currentTarget.style.background = '#ffffff';
- e.currentTarget.style.boxShadow = '0 4px 12px rgba(0, 0, 0, 0.08)';
- }}
- onMouseLeave={(e) => {
- e.currentTarget.style.background = 'linear-gradient(135deg, rgba(248, 250, 252, 0.9) 0%, rgba(241, 245, 249, 0.9) 100%)';
- e.currentTarget.style.boxShadow = 'none';
- }}
- >
-
}
- style={{
- background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)',
- boxShadow: '0 4px 12px rgba(99, 102, 241, 0.3)',
- }} />
-
- {user?.username}
-
-
-