import { request } from 'umi';

export const importUsers = (file, param) => {
  // console.log(params);
  const data = new FormData();
  data.append('file', file);
  let param1 = JSON.stringify(param);
  data.append('param', param1);
  return request('/xiaojing/server/common/userUpload', {
    data,
    method: 'post',
    parseResponse: true,
  });
};

// 导出失败
export const exportUsersError = (param) => {
  // // console.log(params);
  const data = new FormData();
  // data.append('file', file);
  let param1 = JSON.stringify(param);
  data.append('param', param1);
  return request('/xiaojing/server/common/userErroDownload', {
    data,
    method: 'post',
    responseType: 'blob',
    headers: {
      contentType: 'application/json;charset=UTF-8',
    },
    getResponse: true,
  });
};
