import {
  uploadFile
} from './request'

export function sessionUpload({
  urls,
  session
}) {
  if (session == 0) {
    uploadFile({
      path: '/ocr/upload',
      url: urls[0].tempFilePath,
      data: {}
    }).then(res => {
      console.log(res);
    })
  } else {
    for (let index = 0; index < urls.length; index++) {
      const element = urls[index];
      uploadFile({
        path: '/ocr/upload',
        url: element.tempFilePath,
        data: {
          sessionId: session
        }
      }).then(res => {
        console.log(res);
      })
    }
  }
}