|
|
|
@@ -1,8 +1,9 @@ |
|
|
|
import { clearSessionToken } from '@/access'; |
|
|
|
import { getLabelStudioUrl } from '@/services/developmentEnvironment'; |
|
|
|
import { setRemoteMenu } from '@/services/session'; |
|
|
|
import { logout } from '@/services/system/auth'; |
|
|
|
import { ClientInfo } from '@/types'; |
|
|
|
import { sleep } from '@/utils/promise'; |
|
|
|
import { sleep, to } from '@/utils/promise'; |
|
|
|
import SessionStorage from '@/utils/sessionStorage'; |
|
|
|
import { oauthLogout } from '@/utils/ui'; |
|
|
|
import { LogoutOutlined, UserOutlined } from '@ant-design/icons'; |
|
|
|
@@ -63,7 +64,10 @@ const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu }) => { |
|
|
|
* 退出登录,并且将当前的 url 保存 |
|
|
|
*/ |
|
|
|
const loginOut = async () => { |
|
|
|
oauthLogout('http://172.20.32.197:31209/oauth/logout'); |
|
|
|
const [res] = await to(getLabelStudioUrl()); |
|
|
|
if (res && res.data) { |
|
|
|
oauthLogout(`${res.data}/oauth/logout`); |
|
|
|
} |
|
|
|
// 至少 1 秒后跳转,希望子系统能完成注销 |
|
|
|
await Promise.all([logout(), sleep(1000)]); |
|
|
|
clearSessionToken(); |
|
|
|
@@ -76,7 +80,7 @@ const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu }) => { |
|
|
|
} |
|
|
|
// setTimeout(() => { |
|
|
|
// gotoLoginPage(); |
|
|
|
// }, 1000); |
|
|
|
// }, 100); |
|
|
|
}; |
|
|
|
const actionClassName = useEmotionCss(({ token }) => { |
|
|
|
return { |
|
|
|
|