feat: 添加令牌ip白名单功能

This commit is contained in:
CalciumIon committed 2024-09-17 20:49:51 +08:00
1 parent 4007b688f9
commit 6d2948d684
6 files changed
+57 -3

No files matched your search

+2
View File
@@ -134,6 +134,7 @@ func AddToken(c *gin.Context) {
UnlimitedQuota: token.UnlimitedQuota,
ModelLimitsEnabled: token.ModelLimitsEnabled,
ModelLimits: token.ModelLimits,
AllowIps: token.AllowIps,
}
err = cleanToken.Insert()
if err != nil {
@@ -221,6 +222,7 @@ func UpdateToken(c *gin.Context) {
cleanToken.UnlimitedQuota = token.UnlimitedQuota
cleanToken.ModelLimitsEnabled = token.ModelLimitsEnabled
cleanToken.ModelLimits = token.ModelLimits
cleanToken.AllowIps = token.AllowIps
}
err = cleanToken.Update()
if err != nil {