Merge branch 'main' of https://github.com/songquanpeng/one-api into songquanpeng-main

This commit is contained in:
wood
2023-11-25 01:48:20 +08:00
23 changed files with 254 additions and 139 deletions

View File

@@ -106,12 +106,6 @@ func TokenAuth() func(c *gin.Context) {
c.Set("id", token.UserId)
c.Set("token_id", token.Id)
c.Set("token_name", token.Name)
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])