Explorar o código

优化json解析

zhangdongming hai 3 semanas
pai
achega
deb53f9652
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      AdminController/DeviceManagementController.py

+ 3 - 1
AdminController/DeviceManagementController.py

@@ -1751,7 +1751,9 @@ class DeviceManagement(View):
             # 获取第一条匹配的记录(通常应该只有一条)
             version_config = version_config_qs.first()
             # 直接使用数据库字段,不需要json.loads
-            other_features = version_config.other_features or {}
+            other_features = ''
+            if version_config.other_features:
+                other_features = json.dumps(version_config.other_features)
 
             # 将数据库字段映射为驼峰命名的响应数据
             req_data = {