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
3b780e33
authored
Sep 12, 2023
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 改为转发的方式获取midjourney图片
parent
59b4bc37
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletions
+10
-1
model/midjourney.go
+8
-0
web/src/components/MjLogsTable.js
+2
-1
No files found.
model/midjourney.go
View file @
3b780e33
package
model
import
"one-api/common"
type
Midjourney
struct
{
Id
int
`json:"id"`
Code
int
`json:"code"`
...
...
@@ -27,6 +29,9 @@ func GetAllUserTask(userId int, startIdx int, num int) []*Midjourney {
if
err
!=
nil
{
return
nil
}
for
_
,
task
:=
range
tasks
{
task
.
ImageUrl
=
common
.
ServerAddress
+
"/mj/image/"
+
task
.
MjId
}
return
tasks
}
...
...
@@ -37,6 +42,9 @@ func GetAllTasks(startIdx int, num int) []*Midjourney {
if
err
!=
nil
{
return
nil
}
for
_
,
task
:=
range
tasks
{
task
.
ImageUrl
=
common
.
ServerAddress
+
"/mj/image/"
+
task
.
MjId
}
return
tasks
}
...
...
web/src/components/MjLogsTable.js
View file @
3b780e33
...
...
@@ -337,7 +337,8 @@ const LogsTable = () => {
<
Table
.
Cell
>
{
log
.
image_url
?
(
<
Link
to
=
{
log
.
image_url
}
target
=
'_blank'
>
点击查看
<
/Link
>
// <Link to={log.image_url} target='_blank'>点击查看</Link>
<
a
href
=
{
log
.
image_url
}
target
=
'_blank'
>
点击查看
<
/a
>
)
:
'暂未生成图片'
}
<
/Table.Cell
>
...
...
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