import request from '@/utils/request';

//获取验证码
export const smsCode = (query: any) => {
  return request({
    url: '/resource/sms/code',
    method: 'get',
    params: query
  });
};

//查询企业工商信息
export const selectBusinessByCustomerName = (name: any) => {
  return request({
    url: '/customer/businessInfo/selectBusinessByCustomerName/' + name,
    method: 'get'
  });
};

//企业注册
export const registerCustomer = (params: any) => {
  return request({
    url: '/customer/pcCustomer/registerCustomer',
    method: 'post',
    data: params
  });
};

//企业规模
export const enterpriseScale = (query: any) => {
  return request({
    url: '/customer/enterpriseScale/list',
    method: 'get',
    params: query
  });
};

//获取经营类目
export const getProductCategoryList = (query: any) => {
  return request({
    url: '/product/category/getProductCategoryList',
    method: 'get',
    params: query
  });
};

//供应商注册

export const registerSupplier = (params: any) => {
  return request({
    url: '/customer/pcCustomer/registerSupplier',
    method: 'post',
    data: params
  });
};

/**
 * 根据手机号查询用户（注册前校验）
 * @param phonenumber 手机号
 */
export const selectByPhone = (phonenumber: string) => {
  return request({
    url: '/system/psSysUser/selectByPhone/' + phonenumber,
    method: 'get',
    timeout: 20000
  });
};
