import { http } from '@/utils/http/axios'
import type { PageParam, PictureSortParam, SetTFParam } from '/#/api'
import { ContentTypeEnum } from '@/enums/httpEnum'

/**
 * 获得手机号验证码
 * @returns
 */
export async function getCode(params: {phone: string,agentcode:string}) {
  const res = await http.request({
    url: `/web/smslogin/sendcode`,
    method: 'get',
    params,
  })
  return res
}

/**
 * 手机号登录
 */
export async function smsLogin(params: any) {
  return http.request({
    url: `/web/smslogin/login`,
    method: 'post',
    params,
    headers: { 'Content-Type': ContentTypeEnum.FORM_DATA },
  })
}

/**
 * 忘记密码第一步
 */
export async function forgetPassword(params: any) {
  return http.request({
    url: `/ocr/sUser/selectSUser`,
    method: 'post',
    params,
  })
}

/**
 * 忘记密码第二步
 */
export async function updateSUser(params: any) {
  return http.request({
    url: `/ocr/sUser/updateSUser`,
    method: 'post',
    params,
  })
}
