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

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

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


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


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


export async function usersPage(options?: {}) {
    return request('/admin/users/page', {
        method: 'POST',
        data: options || {},
    });
}

export async function usersCardPage(options?: {}) {
    return request('/admin/users/card/page', {
        method: 'POST',
        data: options || {},
    });
}

export async function addCardBalance(options?: {}) {
    return request('/admin/users/card/addCardBalance', {
        method: 'POST',
        data: options || {},
    });
}

export async function recordPage(options?: {}) {
    return request('/admin/user/card/record/page', {
        method: 'POST',
        data: options || {},
    });
}

export async function walletRecordPage(options?: {}) {
    return request('/admin/users/wallet/record/page', {
        method: 'POST',
        data: options || {},
    });
}

export async function refundAmount(options?: {}) {
    return request('/admin/users/wallet/record/refundAmount', {
        method: 'POST',
        data: options || {},
    });
}


