fix: 修复 WAF 规则组保存/绑定网站时报 of_waf_rule_group_bindings_pkey 冲突

This commit is contained in:
ryan
2026-06-20 21:52:33 +08:00
parent 99f6f3231a
commit 117d473c27
11 changed files with 194 additions and 29 deletions
+3 -3
View File
@@ -71,7 +71,7 @@ local function load_pow_config()
local groups = {}
for _, group in ipairs(decoded.rule_groups) do
if group.pow_enabled then
groups[tostring(group.id)] = group.pow_config
groups[tostring(group.id)] = group.pow_config or {}
end
end
-- Build site name to pow_config map
@@ -88,12 +88,12 @@ local function load_pow_config()
if not pow_config then
for _, group in ipairs(decoded.rule_groups) do
if group.is_global and group.pow_enabled then
pow_config = group.pow_config
pow_config = group.pow_config or {}
break
end
end
end
if pow_config then
if pow_config ~= nil then
pow_config_dict:set(site, cjson.encode({enabled = true, config = pow_config}), 0)
domain_keys[#domain_keys+1] = site
end