import request from '@/utils/request'

// process.env.VUE_APP_BASIC_API
const BASE_API = process.env.VUE_APP_BASIC_API

// 车卡文件上传
export const postVinUpload = `${BASE_API}file/upload`

// 上传图片-加水印加密
export const cuscImageUpload = `${BASE_API}cuscImage/upload`

export function enterpriseSubmitRnr(options) {
  return request({
    url: `${BASE_API}enterpriseRnr/submitRnr`,
    ...options
  })
}

/**
 * 获取活体认证code
 * @yapi http://10.166.2.23:3000/mock/28/personalRnr/getLivenessCode
 */
export function getLivenessCode(data) {
  return request({
    method: 'get',
    url: `${BASE_API}personalRnr/getLivenessCode`,
    data
  })
}

/**
 * 企业实名H5提交
 * @yapi http://yapi.cusc.com:3000/project/28/interface/api/10984
 */
export const submitEnterpriseRnr = data => {
  return request({
    url: `${BASE_API}enterpriseRnr/h5/submitRnr`,
    data
  })
}

/**
 * 企业实名h5提交 - 文件上传版本
 */
export const submitEnterpriseRnrWithFile = data => {
  return request({
    url: `${BASE_API}enterpriseRnr/h5/submitRnrWithFile`,
    data
  })
}

/**
 * 企业实名H5活体回调
 * @yapi http://yapi.cusc.com:3000/project/28/interface/api/10988
 */
export const enterpriseLivenessCallback = data => {
  return request({
    url: `${BASE_API}enterpriseRnr/h5/livenessCallback`,
    data
  })
}
