Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c8447fe4
authored
Jan 17, 2025
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【功能评审】Bpm:审批签名
parent
e8e357b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
src/utils/download.ts
+4
-6
No files found.
src/utils/download.ts
View file @
c8447fe4
...
...
@@ -66,7 +66,7 @@ const download = {
a
.
click
()
}
},
base64ToFile
:
(
base64
,
fileName
)
=>
{
base64ToFile
:
(
base64
:
any
,
fileName
:
string
)
=>
{
// 将base64按照 , 进行分割 将前缀 与后续内容分隔开
const
data
=
base64
.
split
(
','
)
// 利用正则表达式 从前缀中获取图片的类型信息(image/png、image/jpeg、image/webp等)
...
...
@@ -85,13 +85,11 @@ const download = {
// charCodeAt():获取给定索引处字符对应的 UTF-16 代码单元
u8arr
[
n
]
=
bstr
.
charCodeAt
(
n
)
}
// 利用构造函数创建File文件对象
//
new File(bits, name, options)
const
file
=
new
File
([
u8arr
],
`
${
fileName
}
.
${
suffix
}
`
,
{
//
将File文件对象返回给方法的调用者
return
new
File
([
u8arr
],
`
${
fileName
}
.
${
suffix
}
`
,
{
type
:
type
})
// 将File文件对象返回给方法的调用者
return
file
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment