import request from '@/utils/request'

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

/**
 * 通过VIN查询ICCID集合
 * @yapi http://10.166.2.23:3000/mock/28/personalRnr/getIccidListByVin
 */
export function getIccidListByVin(options) {
  return request({
    url: `${BASE_API}vehicleCard/getIccidListByVin`,
    ...options
  })
}

export function getNeCarUnBindIccidList(options) {
  return request({
    url: `${BASE_API}vehicleCard/getNeCarUnBindIccidList`,
    ...options
  })
}

/**
* 提交自然人实名认证（点击客户信息下一步时直接提交）
* @yapi http://10.166.2.23:3000/mock/28/personalRnr/submitRnr
*/
export function submitPersonRealNameAuth(options) {
  return request({
    url: `${BASE_API}personalRnr/submitRnr`,
    ...options
  })
}

/**
 * 提交自然人实名认证
 * @yapi http://yapi.cusc.com:3000/project/28/interface/api/8608
 */
export const submitPersonRealNameAuthH5 = data => {
  return request({
    url: `${BASE_API}personalRnr/h5/submitRnr`,
    data
  })
}

/**
 * 活体检测结果回调
 * @yapi http://10.166.2.23:3000/project/28/interface/api/8604
 */
export const livenessCallback = data => {
  return request({
    url: `${BASE_API}personalRnr/h5/livenessCallback`,
    data
  })
}

/**
* 验证车卡信息
* @yapi http://10.166.2.23:3000/mock/28/personalRnr/verifyVinCards
*/
export function verifyVinCardsInfo(data) {
  return request({
    url: `${BASE_API}personalRnr/verifyVinCards`,
    data
  })
}

/**
 * 发送短信验证码
 * @yapi http://10.166.2.23:3000/mock/28/sms/sendSmsRnr
 */
export function sendSmsCaptcha(data) {
  return request({
    url: `${BASE_API}sms/sendSmsRnr`,
    data
  })
}

/**
 * 获取活体认证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
  })
}

/**
 * 短信验证码核验
 * @yapi http://10.166.2.23:3000/project/28/interface/api/12076
 */
export function checkSmsCaptcha(data) {
  return request({
    method: 'POST',
    url: `${BASE_API}message/checkSmsCaptcha`,
    data
  })
}
