We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8e357b commit c8447feCopy full SHA for c8447fe
src/utils/download.ts
@@ -66,7 +66,7 @@ const download = {
66
a.click()
67
}
68
},
69
- base64ToFile: (base64, fileName) => {
+ base64ToFile: (base64: any, fileName: string) => {
70
// 将base64按照 , 进行分割 将前缀 与后续内容分隔开
71
const data = base64.split(',')
72
// 利用正则表达式 从前缀中获取图片的类型信息(image/png、image/jpeg、image/webp等)
@@ -85,13 +85,11 @@ const download = {
85
// charCodeAt():获取给定索引处字符对应的 UTF-16 代码单元
86
u8arr[n] = bstr.charCodeAt(n)
87
88
- // 利用构造函数创建File文件对象
89
- // new File(bits, name, options)
90
- const file = new File([u8arr], `${fileName}.${suffix}`, {
+
+ // 将File文件对象返回给方法的调用者
+ return new File([u8arr], `${fileName}.${suffix}`, {
91
type: type
92
})
93
- // 将File文件对象返回给方法的调用者
94
- return file
95
96
97
0 commit comments