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

+1
View File
@@ -175,6 +175,7 @@ func TokenAuth() func(c *gin.Context) {
} else {
c.Set("token_model_limit_enabled", false)
}
c.Set("allow_ips", token.GetIpLimitsMap())
if len(parts) > 1 {
if model.IsAdmin(token.UserId) {
c.Set("specific_channel_id", parts[1])