content: import React from 'react'
  
  import { Link } from 'react-router'
  import { Dropdown, Menu, Icon } from 'antd'
  
  import { Session, history } from 'lib'
  
  export default class IndexAvator extends React.Component {
    static propTypes = {
      name: React.PropTypes.string,
      data: React.PropTypes.object,
    }
  
    constructor(props) {
      super(props)
    }
  
    handleLogout() {
      Session.clear()
      history.go(`/`)
    }
  
    render() {
      const avatorDropdown = (
        <Menu>
          <Menu.Item key="0">
            <Link>账户信息</Link>
          </Menu.Item>
          <Menu.Item key="1">
            <Link>修改密码</Link>
          </Menu.Item>
          <Menu.Divider />
          <Menu.Item key="3">
            <Link onClick={this.handleLogout}>注销</Link>
          </Menu.Item>
        </Menu>
      )
  
      return (
        <Dropdown overlay={avatorDropdown} trigger={['click']}>
          <a className="ant-dropdown-link">
            {this.props.data.name}
            <Icon type="down" />
          </a>
        </Dropdown>
      )
    }
  }
  
  