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
127d1d69
authored
Jul 23, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(distributor): add validation for model name in channel selection
parent
5418bb3b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
middleware/distributor.go
+4
-0
No files found.
middleware/distributor.go
View file @
127d1d69
...
@@ -100,6 +100,10 @@ func Distribute() func(c *gin.Context) {
...
@@ -100,6 +100,10 @@ func Distribute() func(c *gin.Context) {
}
}
if
shouldSelectChannel
{
if
shouldSelectChannel
{
if
modelRequest
.
Model
==
""
{
abortWithOpenAiMessage
(
c
,
http
.
StatusBadRequest
,
"未指定模型名称,模型名称不能为空"
)
return
}
var
selectGroup
string
var
selectGroup
string
channel
,
selectGroup
,
err
=
model
.
CacheGetRandomSatisfiedChannel
(
c
,
userGroup
,
modelRequest
.
Model
,
0
)
channel
,
selectGroup
,
err
=
model
.
CacheGetRandomSatisfiedChannel
(
c
,
userGroup
,
modelRequest
.
Model
,
0
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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