Browse Source

优化NVR单通道消息提醒设置

zhangdongming 7 months ago
parent
commit
375d61f37d
1 changed files with 3 additions and 3 deletions
  1. 3 3
      Controller/DetectControllerV2.py

+ 3 - 3
Controller/DetectControllerV2.py

@@ -130,12 +130,12 @@ class DetectControllerViewV2(View):
                 # 如果没有找到匹配,添加 new_data
                 nvr_list.append(new_data)
                 msg_notify['nvr'] = nvr_list
+                return msg_notify
             elif is_nvr == 0:
+                # 检查 data 中是否存在 nvr 键,如果存在则删除
                 if 'nvr' in data:
                     del data['nvr']  # 删除 nvr 键
-
-                return msg_notify
-            return data
+            return data  # 返回更新后的 data
         except Exception as e:
             # 记录异常信息
             LOGGER.error('修改消息提醒params: {}: errLine: {}, errMsg: {}'.format(