import request from '@/utils/request';

/**
 * 分页查询
 * @param params 查询条件
 */
export async function pageCustomer(params) {
  const res = await request.get('/receiver/customer/page', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

export async function getCustomer(params) {
  const res = await request.get('/receiver/customer', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

export async function pageCustomerOptLog(params) {
  const res = await request.get('/receiver/customer/opt', {
    params
  });
  if (res.data.code === 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}
