Browse Source

fix: redirect use react router pathname

pull/10257/head
chenshuai2144 4 years ago
parent
commit
00151a634b
  1. 13
      src/components/RightContent/AvatarDropdown.tsx

13
src/components/RightContent/AvatarDropdown.tsx

@ -13,13 +13,14 @@ export type GlobalHeaderRightProps = {
menu?: boolean;
};
/**
const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu }) => {
/**
* 退 url
*/
const loginOut = async () => {
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
@ -31,9 +32,7 @@ const loginOut = async () => {
}),
});
}
};
const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu }) => {
};
const { initialState, setInitialState } = useModel('@@initialState');
const onMenuClick = useCallback(

Loading…
Cancel
Save