Browse Source
路径带有请求参数时,退出跳转添加并携带 (#9264)
* 路径带有请求参数时,退出跳转添加并携带
* Update AvatarDropdown.tsx
pull/9298/head
SmallBun
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
src/components/RightContent/AvatarDropdown.tsx
|
|
@ -17,14 +17,14 @@ export type GlobalHeaderRightProps = { |
|
|
*/ |
|
|
*/ |
|
|
const loginOut = async () => { |
|
|
const loginOut = async () => { |
|
|
await outLogin(); |
|
|
await outLogin(); |
|
|
const { query = {}, pathname } = history.location; |
|
|
const { query = {}, search, pathname } = history.location; |
|
|
const { redirect } = query; |
|
|
const { redirect } = query; |
|
|
// Note: There may be security issues, please note
|
|
|
// Note: There may be security issues, please note
|
|
|
if (window.location.pathname !== '/user/login' && !redirect) { |
|
|
if (window.location.pathname !== '/user/login' && !redirect) { |
|
|
history.replace({ |
|
|
history.replace({ |
|
|
pathname: '/user/login', |
|
|
pathname: '/user/login', |
|
|
search: stringify({ |
|
|
search: stringify({ |
|
|
redirect: pathname, |
|
|
redirect: pathname + search, |
|
|
}), |
|
|
}), |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|