// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 发送验证码 POST /api/login/captcha */
export async function getFakeCaptcha(
  params: {
    // query
    /** 手机号 */
    phone?: string;
  },
  options?: { [key: string]: any },
) {
  return request<API.FakeCaptcha>('/api/login/captcha', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/**
 * 获取验证码id
 * @returns
 */
export async function getCaptchaId() {
  return request(`/web/v1/login/captchaid`);
}

/**
 * 获取验证码图片
 * @param params
 * @returns
 */
export async function getCaptcha(params: any) {
  return request(`/web/v1/login/captcha?id=${params}`);
}
