From 0bd9e1222d867893b66044b04754d9cc967d472e Mon Sep 17 00:00:00 2001
From: liuwh <hugeinfo123>
Date: Mon, 06 Apr 2020 16:49:45 +0800
Subject: [PATCH] 新建文档
---
src/components/common/HeadView/index.jsx | 34 ++++++++++++++++++++++++++++++----
1 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/src/components/common/HeadView/index.jsx b/src/components/common/HeadView/index.jsx
index 96ed163..f133c44 100644
--- a/src/components/common/HeadView/index.jsx
+++ b/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, boxShadow: 'inset 0 -1px 0 0 #E5E5E5' }} />
- );
+ 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>
+ );
}
--
Gitblit v1.8.0