/*
 * @Note:
 * @Author: 2058827620@qq.com
 * @Date: 2022-04-03 10:53:25
 */
import { Button, Space } from 'antd';

import Theme from './Theme';
import { history } from '@umijs/max';

import services from '@/services/admin';

const { adminLogout } = services.AdminController;

export default (props) => {

  const logout = async () => {

    const { success } = await adminLogout();

    if (success) {
      history.push('/login');
    }
  };

  return (
    <div
      className={`h-full flex items-center	justify-end	`}
    >
      <Space>
        {/* <Theme /> */}
        <Button
          onClick={() => {
            logout();
          }}
        >退出登录</Button>
      </Space>
    </div>

  );
};

