diff --git a/react-ui/src/components/RightContent/AvatarDropdown.tsx b/react-ui/src/components/RightContent/AvatarDropdown.tsx index d3fa9e97..929109bb 100644 --- a/react-ui/src/components/RightContent/AvatarDropdown.tsx +++ b/react-ui/src/components/RightContent/AvatarDropdown.tsx @@ -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 = ({ 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 = ({ menu }) => { } // setTimeout(() => { // gotoLoginPage(); - // }, 1000); + // }, 100); }; const actionClassName = useEmotionCss(({ token }) => { return {