Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ems3.3
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wuhao
ems3.3
Commits
1e27f319
Commit
1e27f319
authored
Feb 08, 2023
by
TZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
haogeniubi
parent
d14b2459
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
24 deletions
+14
-24
AvatarDropdown.jsx
src/components/RightContent/AvatarDropdown.jsx
+14
-24
No files found.
src/components/RightContent/AvatarDropdown.jsx
View file @
1e27f319
...
...
@@ -19,12 +19,9 @@ import moment from 'moment';
*/
const
loginOut
=
async
()
=>
{
const
{
logoutRedirectUrl
}
=
await
fakeAccountLoginOut
();
const
{
query
=
{}
}
=
history
.
location
;
const
{
redirect
}
=
query
;
// Note: There may be security issues, please note
if
(
window
.
location
.
pathname
!==
'/user/login'
&&
!
redirect
)
{
if
(
window
.
location
.
pathname
!==
'/user/login'
)
{
localStorage
.
clear
();
window
.
location
.
href
=
logoutRedirectUrl
;
window
.
location
.
replace
(
logoutRedirectUrl
)
;
}
};
...
...
@@ -85,25 +82,18 @@ const AvatarDropdown = ({ menu }) => {
},
};
},
[]);
const
onMenuClick
=
useCallback
(
(
event
)
=>
{
const
{
key
}
=
event
;
if
(
key
===
'logout'
)
{
setInitialState
((
s
)
=>
({
...
s
,
currentUser
:
undefined
,
newMenu
:
undefined
,
}));
loginOut
();
return
;
}
else
if
(
key
==
'changepwd'
)
{
cv
(
true
);
return
;
}
history
.
push
(
`/account/
${
key
}
`
);
},
[
setInitialState
],
);
const
onMenuClick
=
(
event
)
=>
{
const
{
key
}
=
event
;
if
(
key
===
'logout'
)
{
loginOut
();
return
;
}
else
if
(
key
==
'changepwd'
)
{
cv
(
true
);
return
;
}
};
const
loadings
=
(
<
HeaderDropdown
overlay=
{
menuHeaderDropdown
}
>
<
React
.
Fragment
>
...
...
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