import request from './request';
import apis from '../config/api';

export default (file) => {
  return new Promise((resolve, reject) => {
    const fm = new FormData()
    fm.append('file', file)
    request({
      ...apis.file.upload,
      data: fm,
    }).then((data) => {
      resolve(data)
    }).catch((err) => {
      reject(err.message || err)
    })
  })
}
