// @ts-ignore
/* eslint-disable */

// 该文件自动生成，请勿手动修改！

// --------------------------------------------------------------------------
// 用户登录认证服务
// --------------------------------------------------------------------------

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

/** 账户密码登录 POST /api/sys/auth/login-by-account */
export async function loginByAccount(data: API.LoginInput, options?: { [key: string]: any }) {
    const url = '/api/sys/auth/login-by-account';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<API.AuthOutput>>(url, config);
    return res?.data;
}

/** 退出登录 POST /api/sys/auth/logout */
export async function logout(options?: { [key: string]: any }) {
    const url = '/api/sys/auth/logout';
    const config = { method: 'POST', ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 获取当前登录用户信息 GET /api/sys/auth/get-login-user */
export async function getLoginUser(options?: { [key: string]: any }) {
    const url = '/api/sys/auth/get-login-user';
    const config = { method: 'GET', ...(options || {}) };
    const res = await request<API.ResponseType<API.LoginOutput>>(url, config);
    return res?.data;
}

/** 获取图形验证码 GET /api/sys/auth/get-captcha */
export async function getCaptcha(options?: { [key: string]: any }) {
    const url = '/api/sys/auth/get-captcha';
    const config = { method: 'GET', ...(options || {}) };
    const res = await request<API.ResponseType<API.GeneralCaptchaOutput>>(url, config);
    return res?.data;
}

/** 校验图形验证码 POST /api/sys/auth/verify-captcha */
export async function verifyCaptcha(
    data: API.GeneralCaptchaInput,
    options?: { [key: string]: any },
) {
    const url = '/api/sys/auth/verify-captcha';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<API.GeneralCaptchaOutput>>(url, config);
    return res?.data;
}

/** 获取临时密码 POST /api/sys/auth/get-temp-password */
export async function getTempPassword(data: API.string[], options?: { [key: string]: any }) {
    const url = '/api/sys/auth/get-temp-password';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<string[]>>(url, config);
    return res?.data;
}

/** getPbkdf2 GET /api/sys/auth/get-pbkdf2 */
export async function getPbkdf2(
    params: {
        /** pwd */
        pwd?: string;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/sys/auth/get-pbkdf2';
    const config = { method: 'GET', params, ...(options || {}) };
    const res = await request<API.ResponseType<string>>(url, config);
    return res?.data;
}

/** comparePbkdf2 POST /api/sys/auth/compare-pbkdf2 */
export async function comparePbkdf2(
    params: {
        /** pwd */
        pwd?: string;
        /** pbpwd */
        pbpwd?: string;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/sys/auth/compare-pbkdf2';
    const config = { method: 'POST', params, ...(options || {}) };
    const res = await request<API.ResponseType<boolean>>(url, config);
    return res?.data;
}

export default {
    /** 账户密码登录 POST /api/sys/auth/login-by-account */
    loginByAccount,
    /** 退出登录 POST /api/sys/auth/logout */
    logout,
    /** 获取当前登录用户信息 GET /api/sys/auth/get-login-user */
    getLoginUser,
    /** 获取图形验证码 GET /api/sys/auth/get-captcha */
    getCaptcha,
    /** 校验图形验证码 POST /api/sys/auth/verify-captcha */
    verifyCaptcha,
    /** 获取临时密码 POST /api/sys/auth/get-temp-password */
    getTempPassword,
    /** getPbkdf2 GET /api/sys/auth/get-pbkdf2 */
    getPbkdf2,
    /** comparePbkdf2 POST /api/sys/auth/compare-pbkdf2 */
    comparePbkdf2,
};
