소스 검색

优化json解析

zhangdongming 4 주 전
부모
커밋
989f719602
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  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 = {