this.$refs.cropper.getCropBlob(async (data) => {
console.log(data, “wenjain”);
const blobToFile = (blob, fileName) => { return new window.File([blob], fileName, { type: blob.type, }); }; let aa = blobToFile(data, “图片.png”); console.log(aa, “blobToFile”);
let formData = new FormData();
formData.append("file", aa);
// formData.append("fileType", 0); //文件类型 0-图片 1-视频 2-文档 3-压缩包
//调用axios上传
const res = await _this.$Http.uploadfile(formData);
console.log(res, "shanxuang");
if (res.status === 200) {
_this.$emit("uploadImgSuccessId", res.data.id);
_this.$emit("uploadImgSuccess", res.data.resourceUrl);
}