Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
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
88bdf948
authored
Nov 28, 2025
by
IcedTangerine
Committed by
GitHub
Nov 28, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2324 from feitianbubu/pr/video-download-oai
feat: 视频下载和界面预览统一使用OAI标准接口
parents
a1829c91
e898e6af
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
controller/video_proxy.go
+4
-5
router/video-router.go
+1
-1
web/src/components/table/task-logs/TaskLogsColumnDefs.jsx
+2
-1
No files found.
controller/video_proxy.go
View file @
88bdf948
...
@@ -117,13 +117,12 @@ func VideoProxy(c *gin.Context) {
...
@@ -117,13 +117,12 @@ func VideoProxy(c *gin.Context) {
return
return
}
}
req
.
Header
.
Set
(
"x-goog-api-key"
,
apiKey
)
req
.
Header
.
Set
(
"x-goog-api-key"
,
apiKey
)
case
constant
.
ChannelTypeAli
:
case
constant
.
ChannelTypeOpenAI
,
constant
.
ChannelTypeSora
:
// Video URL is directly in task.FailReason
videoURL
=
task
.
FailReason
default
:
// Default (Sora, etc.): Use original logic
videoURL
=
fmt
.
Sprintf
(
"%s/v1/videos/%s/content"
,
baseURL
,
task
.
TaskID
)
videoURL
=
fmt
.
Sprintf
(
"%s/v1/videos/%s/content"
,
baseURL
,
task
.
TaskID
)
req
.
Header
.
Set
(
"Authorization"
,
"Bearer "
+
channel
.
Key
)
req
.
Header
.
Set
(
"Authorization"
,
"Bearer "
+
channel
.
Key
)
default
:
// Video URL is directly in task.FailReason
videoURL
=
task
.
FailReason
}
}
req
.
URL
,
err
=
url
.
Parse
(
videoURL
)
req
.
URL
,
err
=
url
.
Parse
(
videoURL
)
...
...
router/video-router.go
View file @
88bdf948
...
@@ -9,9 +9,9 @@ import (
...
@@ -9,9 +9,9 @@ import (
func
SetVideoRouter
(
router
*
gin
.
Engine
)
{
func
SetVideoRouter
(
router
*
gin
.
Engine
)
{
videoV1Router
:=
router
.
Group
(
"/v1"
)
videoV1Router
:=
router
.
Group
(
"/v1"
)
videoV1Router
.
GET
(
"/videos/:task_id/content"
,
controller
.
VideoProxy
)
videoV1Router
.
Use
(
middleware
.
TokenAuth
(),
middleware
.
Distribute
())
videoV1Router
.
Use
(
middleware
.
TokenAuth
(),
middleware
.
Distribute
())
{
{
videoV1Router
.
GET
(
"/videos/:task_id/content"
,
controller
.
VideoProxy
)
videoV1Router
.
POST
(
"/video/generations"
,
controller
.
RelayTask
)
videoV1Router
.
POST
(
"/video/generations"
,
controller
.
RelayTask
)
videoV1Router
.
GET
(
"/video/generations/:task_id"
,
controller
.
RelayTask
)
videoV1Router
.
GET
(
"/video/generations/:task_id"
,
controller
.
RelayTask
)
}
}
...
...
web/src/components/table/task-logs/TaskLogsColumnDefs.jsx
View file @
88bdf948
...
@@ -363,12 +363,13 @@ export const getTaskLogsColumns = ({
...
@@ -363,12 +363,13 @@ export const getTaskLogsColumns = ({
const
isSuccess
=
record
.
status
===
'SUCCESS'
;
const
isSuccess
=
record
.
status
===
'SUCCESS'
;
const
isUrl
=
typeof
text
===
'string'
&&
/^https
?
:
\/\/
/
.
test
(
text
);
const
isUrl
=
typeof
text
===
'string'
&&
/^https
?
:
\/\/
/
.
test
(
text
);
if
(
isSuccess
&&
isVideoTask
&&
isUrl
)
{
if
(
isSuccess
&&
isVideoTask
&&
isUrl
)
{
const
videoUrl
=
`/v1/videos/
${
record
.
task_id
}
/content`
;
return
(
return
(
<
a
<
a
href=
'#'
href=
'#'
onClick=
{
(
e
)
=>
{
onClick=
{
(
e
)
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
openVideoModal
(
text
);
openVideoModal
(
videoUrl
);
}
}
}
}
>
>
{
t
(
'点击预览视频'
)
}
{
t
(
'点击预览视频'
)
}
...
...
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