dever 6 年之前
父节点
当前提交
531dc31799
共有 1 个文件被更改,包括 6 次插入5 次删除
  1. 6 5
      admin/page/device.py

+ 6 - 5
admin/page/device.py

@@ -141,11 +141,12 @@ class info_path(Load):
 					type_info = device_type[value['type_id']]
 					if type_info:
 						self.data['list'][key]['type'] = type_info['name']
-				info = gateway[value['gateway_id']]
-				if info:
-					self.data['list'][key]['gateway'] = info['name']
-				else:
-					self.data['list'][key]['gateway'] = '无'
+				self.data['list'][key]['gateway'] = '无'
+				if value['gateway_id'] in gateway:
+					info = gateway[value['gateway_id']]
+					if info:
+						self.data['list'][key]['gateway'] = info['name']
+					
 				if value['status']:
 					self.data['list'][key]['status'] = '已连接'
 				else: