forked from huge/frontEnd/hugeOA

Mr Ke
2020-04-06 9abfbe0e27583a27790e24c8304d1497eb8aa2f6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* eslint-disable */
/**柯礼钦
 * 4/2/2020, 11:22:51 AM
 * doc comment for the file goes here
 */
 
/** 头部组件 */
 
import React from 'react';
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, 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>
  );
}