mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-09 18:23:40 +08:00
Compare commits
2 Commits
v0.6.5-alp
...
v0.6.5-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3af4649b52 | ||
|
|
52c32c0b4a |
@@ -116,7 +116,7 @@ func TokenAuth() func(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
requestModel, err := getRequestModel(c)
|
requestModel, err := getRequestModel(c)
|
||||||
if err != nil && !strings.HasPrefix(c.Request.URL.Path, "/v1/models") {
|
if err != nil && shouldCheckModel(c) {
|
||||||
abortWithMessage(c, http.StatusBadRequest, err.Error())
|
abortWithMessage(c, http.StatusBadRequest, err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -142,3 +142,19 @@ func TokenAuth() func(c *gin.Context) {
|
|||||||
c.Next()
|
c.Next()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func shouldCheckModel(c *gin.Context) bool {
|
||||||
|
if strings.HasPrefix(c.Request.URL.Path, "/v1/completions") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if strings.HasPrefix(c.Request.URL.Path, "/v1/chat/completions") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if strings.HasPrefix(c.Request.URL.Path, "/v1/images") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if strings.HasPrefix(c.Request.URL.Path, "/v1/audio") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|||||||
@@ -157,7 +157,9 @@ const LoginForm = () => {
|
|||||||
borderRadius: "10em",
|
borderRadius: "10em",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
cursor: "pointer"
|
cursor: "pointer"
|
||||||
}}>
|
}}
|
||||||
|
onClick={() => onLarkOAuthClicked(status.lark_client_id)}
|
||||||
|
>
|
||||||
<Image
|
<Image
|
||||||
src={larkIcon}
|
src={larkIcon}
|
||||||
avatar
|
avatar
|
||||||
|
|||||||
Reference in New Issue
Block a user