export default function(data){
  return new Promise((resolve, reject) => {
    if (data) {
      if (data.dataList || data.dataList === null){
        resolve(data.dataList);
      } else if (data.result || data.result === null){
        if(data.content){
          resolve(data);
        }else{
          resolve(data.result);
        }
      }else if (data == 'TypeError: Failed to fetch'){
        reject(data);
      }else{
        resolve(data);
      }
      
    } else {
        reject(data);
    }
  });
}
