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
2ca3ea70
Commit
2ca3ea70
authored
Oct 01, 2026
by
Jeff nan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加安全验证
parent
6e693dc1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
index.js
form/index.js
+25
-5
No files found.
form/index.js
View file @
2ca3ea70
...
@@ -211,6 +211,15 @@ function initVueApp(savedData) {
...
@@ -211,6 +211,15 @@ function initVueApp(savedData) {
};
};
return
map
[
key
]
||
key
;
return
map
[
key
]
||
key
;
},
},
async
getAuthKey
()
{
const
resp
=
await
callServerMethod
(
'
getAuthKey
'
);
if
(
resp
.
msg
==
'
success
'
)
{
return
resp
.
data
;
}
else
{
this
.
$message
.
error
(
resp
.
data
);
return
''
;
}
},
// 结果 key -> 中文名称(去人声)
// 结果 key -> 中文名称(去人声)
getVocalKeyZh
(
key
)
{
getVocalKeyZh
(
key
)
{
const
map
=
{
const
map
=
{
...
@@ -260,6 +269,15 @@ function initVueApp(savedData) {
...
@@ -260,6 +269,15 @@ function initVueApp(savedData) {
return
isStaging
?
'
https://stagingopensource.iteachabc.com
'
:
'
https://opensource.iteachabc.com
'
;
return
isStaging
?
'
https://stagingopensource.iteachabc.com
'
:
'
https://opensource.iteachabc.com
'
;
},
},
// open API 鉴权 headers
async
getApiAuthHeaders
(
extra
)
{
const
authKey
=
await
this
.
getAuthKey
();
return
Object
.
assign
({
auth_key
:
authKey
||
''
,
user_sign
:
'
syllabus_cw_make
'
,
},
extra
||
{});
},
// 开始字幕任务轮询
// 开始字幕任务轮询
startSubtitlePolling
(
taskUuid
)
{
startSubtitlePolling
(
taskUuid
)
{
const
uuid
=
taskUuid
||
this
.
task_uuid
;
const
uuid
=
taskUuid
||
this
.
task_uuid
;
...
@@ -273,7 +291,8 @@ function initVueApp(savedData) {
...
@@ -273,7 +291,8 @@ function initVueApp(savedData) {
const
resp
=
await
fetch
(
`
${
base
}
/open/api/ai/dpe/v1/common/task?task_uuid=
${
encodeURIComponent
(
uuid
)}
`
,
{
const
resp
=
await
fetch
(
`
${
base
}
/open/api/ai/dpe/v1/common/task?task_uuid=
${
encodeURIComponent
(
uuid
)}
`
,
{
method
:
'
GET
'
,
method
:
'
GET
'
,
mode
:
'
cors
'
,
mode
:
'
cors
'
,
cache
:
'
no-cache
'
cache
:
'
no-cache
'
,
headers
:
await
this
.
getApiAuthHeaders
(),
});
});
const
json
=
await
resp
.
json
();
const
json
=
await
resp
.
json
();
if
(
json
&&
json
.
code
===
200
&&
json
.
data
)
{
if
(
json
&&
json
.
code
===
200
&&
json
.
data
)
{
...
@@ -330,7 +349,8 @@ function initVueApp(savedData) {
...
@@ -330,7 +349,8 @@ function initVueApp(savedData) {
const
resp
=
await
fetch
(
`
${
base
}
/open/api/ai/dpe/v1/common/task?task_uuid=
${
encodeURIComponent
(
uuid
)}
`
,
{
const
resp
=
await
fetch
(
`
${
base
}
/open/api/ai/dpe/v1/common/task?task_uuid=
${
encodeURIComponent
(
uuid
)}
`
,
{
method
:
'
GET
'
,
method
:
'
GET
'
,
mode
:
'
cors
'
,
mode
:
'
cors
'
,
cache
:
'
no-cache
'
cache
:
'
no-cache
'
,
headers
:
await
this
.
getApiAuthHeaders
(),
});
});
const
json
=
await
resp
.
json
();
const
json
=
await
resp
.
json
();
if
(
json
&&
json
.
code
===
200
&&
json
.
data
)
{
if
(
json
&&
json
.
code
===
200
&&
json
.
data
)
{
...
@@ -631,7 +651,7 @@ function initVueApp(savedData) {
...
@@ -631,7 +651,7 @@ function initVueApp(savedData) {
try
{
try
{
const
resp
=
await
fetch
(
`
${
base
}
/open/api/ai/dpe/v1/video/subtitles`
,
{
const
resp
=
await
fetch
(
`
${
base
}
/open/api/ai/dpe/v1/video/subtitles`
,
{
method
:
'
POST
'
,
method
:
'
POST
'
,
headers
:
{
'
Content-Type
'
:
'
application/json
'
}
,
headers
:
await
this
.
getApiAuthHeaders
({
'
Content-Type
'
:
'
application/json
'
})
,
body
:
JSON
.
stringify
({
video_url
:
videoUrl
})
body
:
JSON
.
stringify
({
video_url
:
videoUrl
})
});
});
const
json
=
await
resp
.
json
();
const
json
=
await
resp
.
json
();
...
@@ -684,7 +704,7 @@ function initVueApp(savedData) {
...
@@ -684,7 +704,7 @@ function initVueApp(savedData) {
try
{
try
{
const
resp
=
await
fetch
(
`
${
base
}
/open/api/ai/dpe/v1/video/vocalbgmute`
,
{
const
resp
=
await
fetch
(
`
${
base
}
/open/api/ai/dpe/v1/video/vocalbgmute`
,
{
method
:
'
POST
'
,
method
:
'
POST
'
,
headers
:
{
'
Content-Type
'
:
'
application/json
'
}
,
headers
:
await
this
.
getApiAuthHeaders
({
'
Content-Type
'
:
'
application/json
'
})
,
body
:
JSON
.
stringify
({
video_url
:
videoUrl
})
body
:
JSON
.
stringify
({
video_url
:
videoUrl
})
});
});
const
json
=
await
resp
.
json
();
const
json
=
await
resp
.
json
();
...
@@ -2388,7 +2408,7 @@ function initVueApp(savedData) {
...
@@ -2388,7 +2408,7 @@ function initVueApp(savedData) {
try
{
try
{
const
resp
=
await
fetch
(
`
${
base
}
/open/api/ai/dpe/v1/video/subtitles/fromjson`
,
{
const
resp
=
await
fetch
(
`
${
base
}
/open/api/ai/dpe/v1/video/subtitles/fromjson`
,
{
method
:
'
POST
'
,
method
:
'
POST
'
,
headers
:
{
'
Content-Type
'
:
'
application/json
'
}
,
headers
:
await
this
.
getApiAuthHeaders
({
'
Content-Type
'
:
'
application/json
'
})
,
body
:
JSON
.
stringify
({
body
:
JSON
.
stringify
({
subtitleJsonUrl
:
subUrl
.
replace
(
'
http://
'
,
'
https://
'
),
subtitleJsonUrl
:
subUrl
.
replace
(
'
http://
'
,
'
https://
'
),
translatedJsonUrl
:
transUrl
.
replace
(
'
http://
'
,
'
https://
'
)
translatedJsonUrl
:
transUrl
.
replace
(
'
http://
'
,
'
https://
'
)
...
...
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