Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
fee9d677
Commit
fee9d677
authored
Jan 13, 2021
by
wufan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:删除无用header文件
parent
df71382d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
135 deletions
+0
-135
src/modules/root/Header.tsx
+0
-135
No files found.
src/modules/root/Header.tsx
deleted
100644 → 0
View file @
df71382d
/*
* @Author: 吴文洁
* @Date: 2019-09-10 18:26:03
* @LastEditors: zhangleyuan
* @LastEditTime: 2020-12-22 15:39:35
* @Description:
*/
import
React
,
{
useContext
,
useState
}
from
'react'
;
import
'./Header.less'
;
import
{
Menu
,
Dropdown
,
Modal
}
from
'antd'
;
import
{
QuestionCircleOutlined
}
from
"@ant-design/icons"
;
import
{
withRouter
}
from
'react-router-dom'
;
import
User
from
'@/common/js/user'
;
import
BaseService
from
"@/domains/basic-domain/baseService"
;
import
{
XMContext
}
from
'@/store/context'
;
import
logoImg
from
'@/common/images/logo.png'
;
const
baseImg
=
'https://image.xiaomaiketang.com/xm/rJeQaZxtc7.png'
const
{
confirm
}
=
Modal
;
interface
headerProps
{
menuType
:
boolean
,
handleMenuType
:()
=>
void
}
function
Header
(
props
:
headerProps
){
const
{
menuType
,
handleMenuType
}
=
props
;
const
ctx
:
any
=
useContext
(
XMContext
);
function
userMenu
()
{
return
(
<
Menu
style=
{
{
maxWidth
:
"250px"
,
marginTop
:
5
,
}
}
>
<
Menu
.
Item
style=
{
{
whiteSpace
:
"normal"
,
wordBreak
:
"break-all"
}
}
key=
"1"
onClick=
{
()
=>
toPersonalInfoPage
()
}
>
个人设置
</
Menu
.
Item
>
<
Menu
.
Item
style=
{
{
whiteSpace
:
"normal"
,
wordBreak
:
"break-all"
}
}
key=
"2"
onClick=
{
e
=>
{
handleLogoutConfirm
();
}
}
>
退出登录
</
Menu
.
Item
>
</
Menu
>
);
}
function
handleMenu
(){
handleMenuType
();
};
function
toPersonalInfoPage
(){
window
.
RCHistory
.
push
({
pathname
:
`/personal-info`
,
})
}
function
handleLogoutConfirm
(){
return
confirm
({
title
:
"你确定要退出登录吗?"
,
content
:
"退出后,需重新登录"
,
icon
:
<
span
className=
"icon iconfont default-confirm-icon"
>

</
span
>,
okText
:
"退出登录"
,
cancelText
:
"点错了"
,
onOk
:
()
=>
{
handleLogout
();
},
});
}
function
handleLogout
(){
BaseService
.
logout
({}).
then
((
res
)
=>
{
User
.
removeUserId
();
User
.
removeToken
();
window
.
RCHistory
.
push
({
pathname
:
`/login`
,
})
});
}
return
(
<
div
id=
"top-container"
className=
"top-container"
>
<
div
className=
"top top-nav"
>
<
div
>
<
img
src=
{
logoImg
}
className=
"logo"
alt=
""
/>
{
menuType
&&
(
<
span
className=
"logo-name"
>
小麦企培
</
span
>
)
}
</
div
>
{
menuType
?
(
<
span
className=
"icon iconfont cursor ml20 handLike"
onClick=
{
handleMenu
}
>

</
span
>
)
:
(
<
span
className=
"icon iconfont cursor ml20 handLike"
onClick=
{
handleMenu
}
>

</
span
>
)
}
<
div
className=
"message-help"
>
<
div
className=
"store-name"
>
{
User
.
getStoreName
()
}
</
div
>
<
Dropdown
overlay=
{
userMenu
()
}
>
<
div
className=
"user"
>
<
img
style=
{
{
width
:
32
+
"px"
,
height
:
32
+
"px"
,
borderRadius
:
"50%"
,
overflow
:
"hidden"
,
flexShrink
:
0
,
}
}
src=
{
(
ctx
.
xmState
&&
ctx
.
xmState
.
storeList
&&
ctx
.
xmState
.
storeList
[
0
].
avatar
)
?
ctx
.
xmState
.
storeList
[
0
].
avatar
:
baseImg
}
/>
{
ctx
.
xmState
&&
ctx
.
xmState
.
storeList
&&
(
<
span
className=
"name"
>
{
ctx
.
xmState
.
storeList
[
0
].
nickName
}
</
span
>
)
}
</
div
>
</
Dropdown
>
</
div
>
</
div
>
</
div
>
);
}
export
default
Header
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment