|
|
|
@ -13,13 +13,14 @@ export type GlobalHeaderRightProps = { |
|
|
|
menu?: boolean; |
|
|
|
}; |
|
|
|
|
|
|
|
const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu }) => { |
|
|
|
/** |
|
|
|
* 退出登录,并且将当前的 url 保存 |
|
|
|
*/ |
|
|
|
const loginOut = async () => { |
|
|
|
await outLogin(); |
|
|
|
const { search, pathname } = window.location; |
|
|
|
const urlParams = new URL(window.location.href).searchParams; |
|
|
|
const { search, pathname } = history.location; |
|
|
|
const urlParams = new URL(history.location.search).searchParams; |
|
|
|
/** 此方法会跳转到 redirect 参数所在的位置 */ |
|
|
|
const redirect = urlParams.get('redirect'); |
|
|
|
// Note: There may be security issues, please note
|
|
|
|
@ -32,8 +33,6 @@ const loginOut = async () => { |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu }) => { |
|
|
|
const { initialState, setInitialState } = useModel('@@initialState'); |
|
|
|
|
|
|
|
const onMenuClick = useCallback( |
|
|
|
|