feat: user settings

This commit is contained in:
jialin
2024-05-30 09:26:09 +08:00
parent a99b58fbb4
commit 69f354b278
14 changed files with 382 additions and 22 deletions
+45 -15
View File
@@ -1,7 +1,13 @@
// @ts-nocheck
import avatarImg from '@/assets/images/avatar.png';
import { LogoutOutlined } from '@ant-design/icons';
import {
GlobalOutlined,
LogoutOutlined,
SettingOutlined,
SunOutlined
} from '@ant-design/icons';
import { useNavigate } from '@umijs/max';
import { Avatar, Dropdown, Menu, Spin, version } from 'antd';
export function getRightRenderContent(opts: {
@@ -52,10 +58,48 @@ export function getRightRenderContent(opts: {
// 如果没有打开Locale,并且头像为空就取消掉这个返回的内容
if (!avatar) return null;
const navigate = useNavigate();
const langMenu = {
className: 'umi-plugin-layout-menu',
selectedKeys: [],
items: [
{
key: 'settings',
label: (
<>
<SettingOutlined />
</>
),
onClick: () => {
navigate('/profile');
}
},
{
key: 'theme',
label: (
<>
<SunOutlined />
</>
),
onClick: () => {
console.log('theme');
}
},
{
key: 'lang',
label: (
<>
<GlobalOutlined />
</>
),
onClick: () => {
console.log('lang');
}
},
{
key: 'logout',
label: (
@@ -67,20 +111,6 @@ export function getRightRenderContent(opts: {
onClick: () => {
opts?.runtimeConfig?.logout?.(opts.initialState);
}
},
{
key: 'theme',
label: <></>,
onClick: () => {
console.log('theme');
}
},
{
key: 'lang',
label: '语言',
onClick: () => {
console.log('lang');
}
}
]
};