#
xjj
2024-02-27 1b576a30a84b8b57f5b7d7a22424f9fc08d08516
zy-asrs-flow/src/components/RightContent/AvatarDropdown.tsx
@@ -8,6 +8,8 @@
import React, { useCallback } from 'react';
import { flushSync } from 'react-dom';
import HeaderDropdown from '../HeaderDropdown';
import { setRemoteMenu } from '@/services/route'
import { removeToken } from '@/utils/token-util'
export type GlobalHeaderRightProps = {
  menu?: boolean;
@@ -43,7 +45,9 @@
   * 退出登录,并且将当前的 url 保存
   */
  const loginOut = async () => {
    await outLogin();
    // await outLogin();
    removeToken();
    setRemoteMenu(null);
    const { search, pathname } = window.location;
    const urlParams = new URL(window.location.href).searchParams;
    /** 此方法会跳转到 redirect 参数所在的位置 */
@@ -100,23 +104,31 @@
  }
  const menuItems = [
    ...(menu
      ? [
          {
            key: 'center',
            icon: <UserOutlined />,
            label: '个人中心',
          },
          {
            key: 'settings',
            icon: <SettingOutlined />,
            label: '个人设置',
          },
          {
            type: 'divider' as const,
          },
        ]
      : []),
    // ...(menu
    //   ? [
    //     {
    //       key: 'center',
    //       icon: <UserOutlined />,
    //       label: '个人中心',
    //     },
    //     {
    //       key: 'settings',
    //       icon: <SettingOutlined />,
    //       label: '个人设置',
    //     },
    //     {
    //       type: 'divider' as const,
    //     },
    //   ]
    //   : []),
    {
      key: 'settings',
      icon: <SettingOutlined />,
      label: '个人设置',
    },
    {
      type: 'divider' as const,
    },
    {
      key: 'logout',
      icon: <LogoutOutlined />,