import { request } from '@umijs/max';

/** 登录接口 POST */
export async function login(body, options?: {}) {
    return request('/api/auth/login', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}

/** 退出登录接口 */
export async function outLogin(options?: {}) {
    return request('/api/auth/logout', {
        method: 'POST',
        ...(options || {}),
    });
}


export async function currentUser(options?: {}) {
    return request('/api/sys/user/getInfo', {
        method: 'GET',
        ...(options || {}),
    });
}

export async function validateCode(options?: {}) {
    return request('/sys/validate/code', {
        method: 'GET',
        ...(options || {}),
    });
}

