import { LogoutOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons' import { Avatar, Menu, Spin } from 'antd' import React from 'react' import { history, connect } from 'umi' import HeaderDropdown from '../HeaderDropdown' import styles from './index.less' class AvatarDropdown extends React.Component { onMenuClick = event => { const { key } = event if (key === 'logout') { const { dispatch } = this.props if (dispatch) { dispatch({ type: 'login/logout' }) } return } history.push(`/account/${key}`) } render() { const { currentUser = { avatar: '', name: '' }, menu } = this.props const menuHeaderDropdown = (
) return currentUser && currentUser.username ? (