新项目, antd6, react19
This commit is contained in:
23
src/components/Header/HeaderUserInfo.tsx
Normal file
23
src/components/Header/HeaderUserInfo.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import { Button, Popconfirm } from 'antd';
|
||||
import { useUserStore } from '@/store/UserStore';
|
||||
import { GapBox } from '../GapBox';
|
||||
|
||||
export const HeaderUserInfo: React.FC = () => {
|
||||
const userInfo = useUserStore().user;
|
||||
|
||||
return (
|
||||
<GapBox>
|
||||
<div>{userInfo.login_name}</div>
|
||||
<Popconfirm
|
||||
title='确定要退出登录吗?'
|
||||
onConfirm={() => {
|
||||
location.hash = '#/login';
|
||||
}}
|
||||
>
|
||||
<Button size='small' variant='text' color='primary'>
|
||||
退出登录
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</GapBox>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user