import { request } from 'umi';

export interface LoginParamsType {
    userName: string;
    password: string;
    mobile: string;
    captcha: string;
    type: string;
}

export async function fakeAccountLogin(params: LoginParamsType) {
    return request<API.LoginStateType>('/api/login/account', {
        method: 'POST',
        data: params,
    });
}

export async function getFakeCaptcha(mobile: string) {
    return request(`/api/login/captcha?mobile=${mobile}`);
}

export async function outLogin() {
    return request('/api/login/outLogin');
}

export async function queryOutLogin() {
    return request('/api/auth/logout/');
}
