mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-15 07:20:26 +00:00
feat: now able to limit ip range for token now (close #1275)
This commit is contained in:
@@ -131,6 +131,7 @@ func AddToken(c *gin.Context) {
|
||||
RemainQuota: token.RemainQuota,
|
||||
UnlimitedQuota: token.UnlimitedQuota,
|
||||
Models: token.Models,
|
||||
Subnet: token.Subnet,
|
||||
}
|
||||
err = cleanToken.Insert()
|
||||
if err != nil {
|
||||
@@ -218,6 +219,7 @@ func UpdateToken(c *gin.Context) {
|
||||
cleanToken.RemainQuota = token.RemainQuota
|
||||
cleanToken.UnlimitedQuota = token.UnlimitedQuota
|
||||
cleanToken.Models = token.Models
|
||||
cleanToken.Subnet = token.Subnet
|
||||
}
|
||||
err = cleanToken.Update()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user