mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-08 23:23:42 +08:00
fix: 完善令牌预扣费逻辑
This commit is contained in:
@@ -115,10 +115,9 @@ func TokenAuth() func(c *gin.Context) {
|
||||
c.Set("id", token.UserId)
|
||||
c.Set("token_id", token.Id)
|
||||
c.Set("token_name", token.Name)
|
||||
c.Set("token_unlimited_quota", token.UnlimitedQuota)
|
||||
if !token.UnlimitedQuota {
|
||||
c.Set("token_quota", token.RemainQuota)
|
||||
} else {
|
||||
c.Set("token_quota", -1)
|
||||
}
|
||||
if token.ModelLimitsEnabled {
|
||||
c.Set("token_model_limit_enabled", true)
|
||||
|
||||
Reference in New Issue
Block a user