fix: fix quota not consuming

This commit is contained in:
JustSong
2023-05-16 13:29:22 +08:00
parent a9ea1d9d10
commit 8afdc56b11
3 changed files with 57 additions and 8 deletions

View File

@@ -111,7 +111,7 @@ func TokenAuth() func(c *gin.Context) {
c.Set("id", token.UserId)
c.Set("token_id", token.Id)
requestURL := c.Request.URL.String()
consumeQuota := !token.UnlimitedQuota
consumeQuota := true
if strings.HasPrefix(requestURL, "/v1/models") {
consumeQuota = false
}