feat: now able to limit ip range for token now (close #1275)

This commit is contained in:
JustSong
2024-04-05 10:09:16 +08:00
parent f02c7138ea
commit c49778c254
10 changed files with 78 additions and 6 deletions

View File

@@ -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 {