feat: 初步兼容midjourney-proxy-plus

This commit is contained in:
CaIon
2024-03-13 15:37:01 +08:00
parent 95d8059c90
commit 37c0c8ebdd
14 changed files with 246 additions and 153 deletions

View File

@@ -125,12 +125,6 @@ func TokenAuth() func(c *gin.Context) {
} else {
c.Set("token_model_limit_enabled", false)
}
requestURL := c.Request.URL.String()
consumeQuota := true
if strings.HasPrefix(requestURL, "/v1/models") {
consumeQuota = false
}
c.Set("consume_quota", consumeQuota)
if len(parts) > 1 {
if model.IsAdmin(token.UserId) {
c.Set("channelId", parts[1])