forked from huge/frontEnd/hugeOA

liuwh
2020-04-06 0bd9e1222d867893b66044b04754d9cc967d472e
src/components/common/HeadView/index.jsx
@@ -7,14 +7,40 @@
/** 头部组件 */
import React from 'react';
import { Layout } from 'antd';
import { Layout, Menu, Dropdown, Icon, Row, Col, message } from 'antd';
const { Header } = Layout;
import './index.scss';
const menu = (
  <Menu>
    <Menu.Item>
      <a onClick={() => {
        // 清空用户相关信息
        window.localStorage.setItem('menu', '');
        window.localStorage.setItem('token', '');
        message.success('退出成功!');
        window.location.href = window.location.origin + '/#/login';
      }}>
        退出
      </a>
    </Menu.Item>
  </Menu>
);
export default function MenuView({ }) {
    return (
        <Header style={{ background: '#fff', padding: 0 }} />
    );
  return (
    <Header style={{ background: '#fff', padding: 0, boxShadow: 'inset 0 -1px 0 0 #E5E5E5' }}>
      <Row type="flex" align="middle" justify="end" >
        <Col style={{ marginRight: 40 }}>
          <Dropdown overlay={menu}>
            <a className="ant-dropdown-link" onClick={e => e.preventDefault()}>
              登陆人<Icon type="down" />
            </a>
          </Dropdown>
        </Col>
      </Row>
    </Header>
  );
}