Commit 1e27f319 authored by TZW's avatar TZW

haogeniubi

parent d14b2459
...@@ -19,12 +19,9 @@ import moment from 'moment'; ...@@ -19,12 +19,9 @@ import moment from 'moment';
*/ */
const loginOut = async () => { const loginOut = async () => {
const { logoutRedirectUrl } = await fakeAccountLoginOut(); const { logoutRedirectUrl } = await fakeAccountLoginOut();
const { query = {} } = history.location; if (window.location.pathname !== '/user/login') {
const { redirect } = query; // Note: There may be security issues, please note
if (window.location.pathname !== '/user/login' && !redirect) {
localStorage.clear(); localStorage.clear();
window.location.href = logoutRedirectUrl; window.location.replace(logoutRedirectUrl);
} }
}; };
...@@ -85,25 +82,18 @@ const AvatarDropdown = ({ menu }) => { ...@@ -85,25 +82,18 @@ const AvatarDropdown = ({ menu }) => {
}, },
}; };
}, []); }, []);
const onMenuClick = useCallback(
(event) => { const onMenuClick = (event) => {
const { key } = event; const { key } = event;
if (key === 'logout') { if (key === 'logout') {
setInitialState((s) => ({ loginOut();
...s, return;
currentUser: undefined, } else if (key == 'changepwd') {
newMenu: undefined, cv(true);
})); return;
loginOut(); }
return; };
} else if (key == 'changepwd') {
cv(true);
return;
}
history.push(`/account/${key}`);
},
[setInitialState],
);
const loadings = ( const loadings = (
<HeaderDropdown overlay={menuHeaderDropdown}> <HeaderDropdown overlay={menuHeaderDropdown}>
<React.Fragment> <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