mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-13 01:23:41 +08:00
feat: 统计无限令牌的已用额度 (close #308)
This commit is contained in:
@@ -272,7 +272,6 @@ func PostConsumeTokenQuota(tokenId int, userQuota int, quota int, preConsumedQuo
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if !token.UnlimitedQuota {
|
|
||||||
if quota > 0 {
|
if quota > 0 {
|
||||||
err = DecreaseTokenQuota(tokenId, quota)
|
err = DecreaseTokenQuota(tokenId, quota)
|
||||||
} else {
|
} else {
|
||||||
@@ -281,7 +280,6 @@ func PostConsumeTokenQuota(tokenId int, userQuota int, quota int, preConsumedQuo
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if sendEmail {
|
if sendEmail {
|
||||||
if (quota + preConsumedQuota) != 0 {
|
if (quota + preConsumedQuota) != 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user