import { CommonUpload } from '../../apis/common';

export async function imageUpload(file, insertFn) {
  let formData = new FormData();
  formData.append('file', file);
  let res = await CommonUpload(formData);
  if (res.code == 200) {
    insertFn(res.data.url, file.name, res.data.key);
  }
}
