Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ai_fundub
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
ai_fundub
Commits
36519112
Commit
36519112
authored
Jan 13, 2026
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat
parent
62c3f146
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
2 deletions
+38
-2
index.js
form/index.js
+38
-2
No files found.
form/index.js
View file @
36519112
...
@@ -1008,8 +1008,8 @@ function initVueApp(savedData) {
...
@@ -1008,8 +1008,8 @@ function initVueApp(savedData) {
this
.
$message
.
success
(
'
新歌词文件已上传并更新链接(避免CDN缓存)
'
);
this
.
$message
.
success
(
'
新歌词文件已上传并更新链接(避免CDN缓存)
'
);
// 可选刷新 CDN 或在URL后追加时间戳避免缓存
// 可选刷新 CDN 或在URL后追加时间戳避免缓存
//
TODO(lyrics): 补全覆盖后触发“重新生成歌词文件”的后端调用逻辑
//
触发后端生成歌词并保存返回结果
//
this.regenerateLyricsAfterUpload();
await
this
.
regenerateLyricsAfterUpload
();
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
error
(
e
);
console
.
error
(
e
);
this
.
$message
.
error
(
'
覆盖上传失败
'
);
this
.
$message
.
error
(
'
覆盖上传失败
'
);
...
@@ -1057,6 +1057,42 @@ function initVueApp(savedData) {
...
@@ -1057,6 +1057,42 @@ function initVueApp(savedData) {
return
out
.
slice
(
0
,
len
);
return
out
.
slice
(
0
,
len
);
},
},
// 调后端接口:基于最新JSON生成歌词,并保存返回链接
async
regenerateLyricsAfterUpload
()
{
const
subUrl
=
(
this
.
subtitlesResult
&&
this
.
subtitlesResult
.
subtitleJsonUrl
)
||
''
;
const
transUrl
=
(
this
.
subtitlesResult
&&
this
.
subtitlesResult
.
translatedJsonUrl
)
||
''
;
if
(
!
subUrl
||
!
transUrl
)
{
this
.
$message
.
error
(
'
缺少最新字幕/翻译 JSON 链接,无法生成歌词
'
);
return
;
}
const
base
=
this
.
getApiBase
();
const
loading
=
this
.
$loading
({
lock
:
true
,
text
:
'
正在重新生成歌词(约3-5分钟)...
'
,
spinner
:
'
el-icon-loading
'
,
background
:
'
rgba(0,0,0,0.7)
'
});
try
{
const
resp
=
await
fetch
(
`
${
base
}
/open/api/ai/dpe/v1/video/subtitles/fromjson`
,
{
method
:
'
POST
'
,
headers
:
{
'
Content-Type
'
:
'
application/json
'
},
body
:
JSON
.
stringify
({
subtitleJsonUrl
:
subUrl
.
replace
(
'
http://
'
,
'
https://
'
),
translatedJsonUrl
:
transUrl
.
replace
(
'
http://
'
,
'
https://
'
)
})
});
const
json
=
await
resp
.
json
();
// 兼容两种返回结构:{code, data} 或 直接返回链接对象
const
data
=
(
json
&&
json
.
code
===
200
&&
json
.
data
)
?
json
.
data
:
json
;
if
(
data
&&
(
data
.
assUrl
||
data
.
srtUrl
||
data
.
vttUrl
))
{
this
.
subtitlesResult
=
Object
.
assign
({},
this
.
subtitlesResult
||
{},
data
);
this
.
saveData
();
this
.
$message
.
success
(
'
歌词生成完成,已保存返回结果
'
);
}
else
{
this
.
$message
.
error
(
'
生成歌词失败:返回数据异常
'
);
}
}
catch
(
e
)
{
console
.
error
(
e
);
this
.
$message
.
error
(
'
生成歌词失败
'
);
}
finally
{
loading
.
close
();
}
},
// 工具:创建并下载JSON文件
// 工具:创建并下载JSON文件
createAndDownloadJson
(
filename
,
data
)
{
createAndDownloadJson
(
filename
,
data
)
{
try
{
try
{
...
...
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