import request from "@/utils/request";


//发送邮箱验证码
export function apitest(email){
  return request({
    url:"/market/company/sendcode/"+email,
    method: "POST",
  })
}



export function reducetestcount(data){
  return request({
    url:"/market/producttest/reducetestcount",
    method: "POST",
    data: data
  })
}

export function iftest(data){
  return request({
    url:"/market/product/iftest",
    method: "POST",
    data: data
  })
}

export function findcount(data){
  return request({
    url:"/market/producttest/findcount",
    method: "POST",
    data: data
  })
}



export function sendrequest(options){
  // 确保options是一个对象，并且包含必要的属性
  if (!options || typeof options !== 'object' || !options.apiRouter || typeof options.parameter === 'undefined') {
    throw new Error('Invalid options: must be an object with apiRouter and optional parameter properties');
  }
// 构建完整的URL
  const fullUrl = `/background/api/${options.apiRouter}/${options.parameter || ''}`;
  return request({
    url:fullUrl,
    method: "get",
    data: options.parameter,
  })
}

export function sendrequest1(options){
  // 确保options是一个对象，并且包含必要的属性
  if (!options || typeof options !== 'object' || !options.apiRouter ) {
    throw new Error('Invalid options: must be an object with apiRouter ');
  }
// 构建完整的URL
  const fullUrl = `/background/api/${options.apiRouter}`;
  return request({
    url:fullUrl,
    method: "post",
    data: options
  })
}




