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 const verifyVinCardsTemplateUrl = `${process.env.VUE_APP_ROUTER}static/template.xlsx`// `${process.env.VUE_APP_OSS_BASE}frontend/cusc-realname-pc/template.xlsx`

// 校验车卡文件
export function verifyVinCards(data) {
  return request({
    url: `${BASE_API}enterpriseRnr/verifyVinCards`,
    data
  })
}

// 下载校验车卡失败文件
export function downloadFailFile(data) {
  return request({
    url: `${BASE_API}file/download`,
    data,
    responseType: 'blob'
  })
}

export function queryCarEnterpriseDetail(data) {
  return request({
    url: `${BASE_API}manufacturerRnr/getDetail`,
    data
  })
}

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

export function submitRnrFollowUp(options) {
  return request({
    url: `${BASE_API}manufacturerRnr/submitRnrFollowUp`,
    ...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
  })
}
