// api/index.js
import request from '@/utils/request.js'

export function getUserInfo(data) {
  return request({
    url: '/user/detail',
    method: 'GET',
    data,
  })
}

export function login(data) {
  return request({
    url: '/user/mobileCodeLogin',
    method: 'POST',
    data,
  })
}
export function getCode(data) {
  return request({
    url: '/auth/sendSms',
    method: 'POST',
    data,
  })
}
export function getProduct(en) {
  return request({
    url: `/product/en/${en}`,
    method: 'GET',
  })
}
export function queryExample(params) {
  return request({
    url: `/query/example`,
    method: 'GET',
    params,
  })
}

export function queryMarriage(data) {
  return request({
    url: `/query/marriage`,
    method: 'POST',
    data,
  })
}
export function queryhomeService(data) {
  return request({
    url: `/query/homeService`,
    method: 'POST',
    data,
  })
}
export function queryriskAssessment(data) {
  return request({
    url: `/query/riskAssessment`,
    method: 'POST',
    data,
  })
}
export function querycompanyInfo(data) {
  return request({
    url: `/query/companyInfo`,
    method: 'POST',
    data,
  })
}
export function queryrentalInfo(data) {
  return request({
    url: `/query/rentalInfo`,
    method: 'POST',
    data,
  })
}
export function querypreLoanBackgroundCheck(data) {
  return request({
    url: `/query/preLoanBackgroundCheck`,
    method: 'POST',
    data,
  })
}
export function querybackgroundCheck(data) {
  return request({
    url: `/query/backgroundCheck`,
    method: 'POST',
    data,
  })
}
export function queryResultByOrder(orderID) {
  return request({
    url: `/query/orderId/${orderID}`,
    method: 'GET',
  })
}
export function queryList(params) {
  return request({
    url: `/query/list`,
    method: 'GET',
    params,
  })
}
export function queryProvisionalOrder(id) {
  return request({
    url: `/query/provisional_order/${id}`,
    method: 'GET',
  })
}
export function payment(data) {
  return request({
    url: `/pay/payment`,
    method: 'POST',
    data,
  })
}
export function iapPaymentCallback(data) {
  return request({
    url: `/pay/iap_callback`,
    method: 'POST',
    data,
  })
}
export function getAgentRevenue() {
  return request({
    url: '/agent/revenue',
    method: 'GET'
  })
}
export function refreshToken() {
  return request({
    url: '/user/getToken',
    method: 'POST',
  });
}


