mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-14 06:20:27 +00:00
fix: only reduce remain times when request /v1/chat/completions
(close #15)
BREAKING CHANGE: now remain_times is -1 doesn't mean unlimited times anymore!
This commit is contained in:
@@ -80,6 +80,8 @@ func TokenAuth() func(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
c.Set("id", token.UserId)
|
||||
c.Set("token_id", token.Id)
|
||||
c.Set("unlimited_times", token.UnlimitedTimes)
|
||||
if len(parts) > 1 {
|
||||
c.Set("channelId", parts[1])
|
||||
}
|
||||
|
Reference in New Issue
Block a user