Skip to content

Commit c8447fe

Browse files
committed
【功能评审】Bpm:审批签名
1 parent e8e357b commit c8447fe

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/utils/download.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const download = {
6666
a.click()
6767
}
6868
},
69-
base64ToFile: (base64, fileName) => {
69+
base64ToFile: (base64: any, fileName: string) => {
7070
// 将base64按照 , 进行分割 将前缀 与后续内容分隔开
7171
const data = base64.split(',')
7272
// 利用正则表达式 从前缀中获取图片的类型信息(image/png、image/jpeg、image/webp等)
@@ -85,13 +85,11 @@ const download = {
8585
// charCodeAt():获取给定索引处字符对应的 UTF-16 代码单元
8686
u8arr[n] = bstr.charCodeAt(n)
8787
}
88-
// 利用构造函数创建File文件对象
89-
// new File(bits, name, options)
90-
const file = new File([u8arr], `${fileName}.${suffix}`, {
88+
89+
// 将File文件对象返回给方法的调用者
90+
return new File([u8arr], `${fileName}.${suffix}`, {
9191
type: type
9292
})
93-
// 将File文件对象返回给方法的调用者
94-
return file
9593
}
9694
}
9795

0 commit comments

Comments
 (0)