“系统设置 -- 安全管理”里可以单独添加允许访问的IP

This commit is contained in:
刘祥超
2021-03-28 15:50:28 +08:00
parent 658c5ae6dd
commit 74e6c7a87c
4 changed files with 43 additions and 0 deletions

View File

@@ -89,6 +89,16 @@ func checkIPWithoutCache(config *systemconfigs.SecurityConfig, ipAddr string) bo
}
}
// 检查单独允许的IP
if len(config.AllowIPRanges()) > 0 {
for _, r := range config.AllowIPRanges() {
if r.Contains(ipAddr) {
return true
}
}
return false
}
return true
}