import { baseURL } from '@/config';
//替换图片路径
export function imgReplacePath(data, field) {
  var fileUrl = baseURL + '/static/img/';
  for (var i = 0; i < data.length; i++) {
    if (null != data[i][field]) {
      var img = data[i][field].split(',');
      if (img.length != 0) {
        var imgArr = [];
        for (var j = 0; j < img.length; j++) {
          if (img[j]) {
            imgArr.push([fileUrl + img[j]]);
          }
        }
        data[i].url = fileUrl + img[0];
        data[i].fileList = imgArr;
      } else {
        data[i].url = '';
        data[i].fileList = '';
      }
    }
  }
  return data;
}
