import { request } from '@/api'

/**
 * 获取照片
 */
export async function getCardInfo(): Promise<any> {
  return request.get<any>('/aws/getInfo')
}

/**
 * 上传实时照片
 */
export async function uploadCard(params: any): Promise<any> {
  return request.post<any>('/aws/uploadCard', params, {
    headers: {
      'Content-Type': 'multipart/form-data', // 表单上传必须的头
    },
  })
}

/**
 * 上传实时照片
 */
export async function uploadLivePhoto(params: any): Promise<any> {
  return request.post<any>('/aws/uploadLivePhoto', params, {
    headers: {
      'Content-Type': 'multipart/form-data', // 表单上传必须的头
    }
  })
}

/**
 * 活体检测
 */
export async function checkLiveness(): Promise<any> {
  return request.post<any>('/aws/checkLiveness')
}

/**
 * 验证身份照片
 */
export async function verifyCard(): Promise<any> {
  return request.post<any>('/aws/verifyCard')
}