feat(布局): 为个人信息菜单项添加图标并简化语言选项显示

为个人信息菜单项添加用户图标,提升视觉一致性
将语言选项的显示从"中文/English"简化为"CN/EN"
This commit is contained in:
2025-08-29 23:46:31 +08:00
parent e6a9145cd4
commit 2b1308956a

View File

@ -285,7 +285,7 @@ export default function MainLayout() {
}, [currentAncestors]) }, [currentAncestors])
const dropdownMenuItems = useMemo(() => ([ const dropdownMenuItems = useMemo(() => ([
{ key: 'profile', label: '个人信息' }, { key: 'profile', label: '个人信息', icon: <UserOutlined /> },
{ type: 'divider' as any }, { type: 'divider' as any },
{ key: 'logout', label: '退出登录', icon: <LogoutOutlined /> }, { key: 'logout', label: '退出登录', icon: <LogoutOutlined /> },
]), []) ]), [])
@ -505,8 +505,8 @@ export default function MainLayout() {
<Dropdown <Dropdown
menu={{ menu={{
items: [ items: [
{ key: 'zh', label: '中文' }, { key: 'zh', label: 'CN' },
{ key: 'en', label: 'English' }, { key: 'en', label: 'EN' },
], ],
onClick: ({ key }) => { const v = key as 'zh'|'en'; setLang(v); localStorage.setItem('lang', v) } onClick: ({ key }) => { const v = key as 'zh'|'en'; setLang(v); localStorage.setItem('lang', v) }
}} }}
@ -514,7 +514,7 @@ export default function MainLayout() {
> >
<Space style={{ cursor: 'pointer', userSelect: 'none' }}> <Space style={{ cursor: 'pointer', userSelect: 'none' }}>
<GlobalOutlined /> <GlobalOutlined />
<span>{lang === 'zh' ? '中文' : 'English'}</span> <span>{lang === 'zh' ? 'CN' : 'EN'}</span>
</Space> </Space>
</Dropdown> </Dropdown>
<Dropdown <Dropdown