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
5a3f011a
authored
Aug 09, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: enhance JSON marshaling for Message and skip Fluent Read links in chat items
parent
20575e79
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
dto/openai_request.go
+8
-0
web/src/components/layout/SiderBar.js
+8
-0
No files found.
dto/openai_request.go
View file @
5a3f011a
...
...
@@ -140,6 +140,14 @@ type Message struct {
//parsedStringContent *string
}
func
(
m
*
Message
)
MarshalJSON
()
([]
byte
,
error
)
{
if
m
.
Content
==
nil
{
m
.
Content
=
""
}
type
Alias
Message
return
json
.
Marshal
((
*
Alias
)(
m
))
}
type
MediaContent
struct
{
Type
string
`json:"type"`
Text
string
`json:"text,omitempty"`
...
...
web/src/components/layout/SiderBar.js
View file @
5a3f011a
...
...
@@ -201,12 +201,20 @@ const SiderBar = ({ onNavigate = () => { } }) => {
if
(
Array
.
isArray
(
chats
))
{
let
chatItems
=
[];
for
(
let
i
=
0
;
i
<
chats
.
length
;
i
++
)
{
let
shouldSkip
=
false
;
let
chat
=
{};
for
(
let
key
in
chats
[
i
])
{
let
link
=
chats
[
i
][
key
];
if
(
typeof
link
!==
'string'
)
continue
;
// 确保链接是字符串
if
(
link
.
startsWith
(
'fluent'
))
{
shouldSkip
=
true
;
continue
;
// 跳过 Fluent Read
}
chat
.
text
=
key
;
chat
.
itemKey
=
'chat'
+
i
;
chat
.
to
=
'/console/chat/'
+
i
;
}
if
(
shouldSkip
)
continue
;
chatItems
.
push
(
chat
);
}
setChatItems
(
chatItems
);
...
...
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