Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
text2video-frontend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周成波
text2video-frontend
Commits
065fa1b8
Commit
065fa1b8
authored
Oct 25, 2024
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
手机保存
parent
8da33cf8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
10 deletions
+23
-10
gen_digit_human_video.vue
src/views/home/gen_digit_human_video.vue
+23
-10
No files found.
src/views/home/gen_digit_human_video.vue
View file @
065fa1b8
...
...
@@ -284,17 +284,30 @@ const onDownloadVideo = async () => {
const
arr_name
=
url
.
split
(
'/'
);
const
file_name
=
arr_name
[
arr_name
.
length
-
1
];
// 获取文件名
if
(
isMobile
.
value
)
{
const
fileBlob
=
await
(
await
fetch
(
url
)).
blob
();
const
shareData
=
{
files
:
[
new
File
([
fileBlob
],
file_name
,
{
type
:
fileBlob
.
type
})]
};
if
(
navigator
.
canShare
(
shareData
))
{
await
navigator
.
share
(
shareData
);
try
{
const
fileBlob
=
await
(
await
fetch
(
url
)).
blob
();
const
blobUrl
=
URL
.
createObjectURL
(
fileBlob
);
// 创建一个隐藏的链接元素
const
link
=
document
.
createElement
(
'a'
);
link
.
href
=
blobUrl
;
link
.
download
=
file_name
;
// 设置下载文件名
// 触发点击事件
document
.
body
.
appendChild
(
link
);
// 将链接添加到 DOM
link
.
click
();
// 模拟点击下载
document
.
body
.
removeChild
(
link
);
// 移除链接
// 释放 URL 对象
URL
.
revokeObjectURL
(
blobUrl
);
ElMessage
(
'下载成功了 (Download success)'
);
}
else
{
ElMessage
.
error
({
message
:
'下载失败'
});
}
catch
(
error
)
{
console
.
error
(
'下载失败:'
,
error
);
ElMessage
.
error
({
message
:
'下载失败'
});
}
}
else
{
await
fetch
(
url
)
.
then
((
url
)
=>
url
.
blob
())
...
...
@@ -333,7 +346,7 @@ const onDownloadVideo = async () => {
<el-form-item
label=
"文案"
>
<el-input
v-model=
"form.text"
:autosize=
"
{ minRows: 2, maxRows: 5 }"
:autosize=
"
{ minRows: 2, maxRows:
isMobile ? 10 :
5 }"
type="textarea"
placeholder="Please input"
/>
...
...
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