Browse Source

fix: 退出登录获取label-studio地址

pull/244/head
cp3hnu 8 months ago
parent
commit
4a6f4d2120
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      react-ui/src/components/RightContent/AvatarDropdown.tsx

+ 7
- 3
react-ui/src/components/RightContent/AvatarDropdown.tsx View File

@@ -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 {


Loading…
Cancel
Save