fix: base64 convert to file for all image type

This commit is contained in:
jialin
2025-03-06 20:27:34 +08:00
parent 36d626c833
commit 106ee43171
2 changed files with 13 additions and 17 deletions
+1 -1
View File
@@ -153,7 +153,7 @@ export const generateRandomNumber = () => {
function base64ToBlob(base64: string, contentType = '', sliceSize = 512) {
try {
const base64Content = base64.replace(/^data:image\/(png|jpg);base64,/, '');
const base64Content = base64.replace(/^data:image\/[^;]+;base64,/, '');
const byteCharacters = atob(base64Content);
const byteArrays = [];