import { http } from '@/utils/http/axios';

const baseUrl = '/api'

export function getDomainList(){
  return http.request({
    url: 'domain.txt',
    method: 'GET'
  },
  {
    withToken: false,
  })
}


/**
 * @description: sendSmsRegister
 */
export function sendSmsRegister(params) {
  return http.request({
    url: `${baseUrl}/customer/open/sms/register`,
    method: 'GET',
    params
  },
  {
    withToken: false,
  });
}
/**
 * @description: sendSmsForget
 */
export function sendSmsForget(params) {
  return http.request({
    url: `${baseUrl}/customer/open/sms/forget`,
    method: 'GET',
    params
  },
  {
    withToken: false,
  });
}

/**
 * @description: login
 */
export function login(data) {
  return http.request({
    url: `${baseUrl}/customer/login`,
    method: 'POST',
    data
  },
  {
    isTransformResponse: false,
    withToken: false,
  });
}

/**
 * @description: register
 */
export function register(data) {
  return http.request({
    url: `${baseUrl}/customer/open/register`,
    method: 'POST',
    data
  },
  {
    withToken: false,
  });
}


/**
 * @description: updatePwd
 */
export function updatePwd(data) {
  return http.request({
    url: `${baseUrl}/customer/open/updatePwd`,
    method: 'POST',
    data
  },
  {
    withToken: false,
  });
}



/**
 * @description: getUserInfo
 */
export function getUserInfo() {
  return http.request({
    url: `${baseUrl}/app/customer/info`,
    method: 'GET'
  });
}


/**
 * 注销账号
 * @description: closeAmount
 */
export function closeAmount() {
  return http.request({
    url: `${baseUrl}/app/user/close/amount`,
    method: 'GET'
  });
}
