浏览代码

判断设备类型是否为DVR,是返回'',不是返回'admin'

guanhailong 3 年之前
父节点
当前提交
6e1560dcbc
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      Controller/EquipmentManagerV3.py

+ 7 - 2
Controller/EquipmentManagerV3.py

@@ -98,6 +98,12 @@ class EquipmentManagerV3(View):
             else:
                 device_info_qs.delete()
 
+        dvr_type_list = [1, 2, 3, 4, 10001]
+        if Type in dvr_type_list:
+            View_Password = ''
+        else:
+            View_Password = 'admin'
+
         id = CommonService.getUserID(getUser=False)
         userName = Device_User.objects.get(userID=userID).username
         main_exist = Device_Info.objects.filter(UID=UID)
@@ -188,8 +194,7 @@ class EquipmentManagerV3(View):
             uid_channel_set = UidChannelSetModel.objects.filter(uid_id=UidSet_id)
             if not uid_channel_set.exists():
                 # 多通道设备设置通道名
-                multi_channel_list = [1, 2, 3, 4, 10001]
-                if Type in multi_channel_list:
+                if Type in dvr_type_list:
                     UidChannelSet_bulk = []
                     for i in range(1, ChannelIndex+1):
                         channel_name = 'channel'+str(i)  # channel1,channel2...