Commit 1e27f319 authored by TZW's avatar TZW

haogeniubi

parent d14b2459
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment