const getImgToBase64 = (file: File) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function () {
console.log(reader.result); //获取到base64格式图片
const fileSend = {
attachType: 'UA012',
img: reader.result,
ocrFlag: '0',
partyType: '1',
type: '1',
};
onBase(fileSend);
};
};
file转base64
最新推荐文章于 2023-09-05 10:26:02 发布