Browse Source

路径带有请求参数时,退出跳转添加并携带 (#9264)

* 路径带有请求参数时,退出跳转添加并携带

* Update AvatarDropdown.tsx
pull/9298/head
SmallBun 4 years ago
committed by GitHub
parent
commit
8e3431b93b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/components/RightContent/AvatarDropdown.tsx

4
src/components/RightContent/AvatarDropdown.tsx

@ -17,14 +17,14 @@ export type GlobalHeaderRightProps = {
*/
const loginOut = async () => {
await outLogin();
const { query = {}, pathname } = history.location;
const { query = {}, search, pathname } = history.location;
const { redirect } = query;
// Note: There may be security issues, please note
if (window.location.pathname !== '/user/login' && !redirect) {
history.replace({
pathname: '/user/login',
search: stringify({
redirect: pathname,
redirect: pathname + search,
}),
});
}

Loading…
Cancel
Save