import http from '@/utils/request';
import type { Response } from '@/utils/request';
import type { LoginRequest, LoginResponse } from './types';
import type { MenuResponse } from '@/pages/System/Menu/types';
import type { TenantResponse } from '@/pages/System/Tenant/types';

// 登录
export const login = (data: LoginRequest) =>
    http.post<LoginResponse>('/api/v1/user/login', data);

// 退出登录
export const logout = () =>
    http.post('/api/v1/user/logout');

// 获取当前用户菜单
export const getCurrentUserMenus = () =>
    http.get<MenuResponse[]>('/api/v1/menu/current');

// 获取租户列表
export const getTenantList = () =>
    http.get<TenantResponse[]>('/api/v1/tenant/list');