From 41ad482a574cf4beb3926ebafb4f6ce132d6a297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Fri, 24 May 2019 01:47:59 +0800 Subject: [PATCH] add loginout --- src/components/GlobalHeader/RightContent.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/GlobalHeader/RightContent.tsx b/src/components/GlobalHeader/RightContent.tsx index 880b8a41..051baa54 100644 --- a/src/components/GlobalHeader/RightContent.tsx +++ b/src/components/GlobalHeader/RightContent.tsx @@ -103,6 +103,14 @@ class GlobalHeaderRight extends Component { return; } const { key } = event; + + if (key === 'logout') { + const { dispatch } = this.props; + dispatch!({ + type: 'login/logout', + }); + return; + } router.push(`/account/${key}`); }; render() { @@ -117,11 +125,11 @@ class GlobalHeaderRight extends Component { - {/* */} - {/* + + - */} + ); const noticeData = this.getNoticeData(); -- GitLab