Browse Source

APP获取图标列表null返回空字符串

zhangdongming 1 năm trước cách đây
mục cha
commit
6d4bd4cbaf
2 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 1 1
      AdminController/DeviceManagementController.py
  2. 1 1
      Model/models.py

+ 1 - 1
AdminController/DeviceManagementController.py

@@ -826,7 +826,7 @@ class DeviceManagement(View):
                         'icon': app_bundle['icon'],
                         'name': app_bundle['name'],
                         'sort': app_bundle['sort'],
-                        'config': app_bundle['config'],
+                        'config': '' if not app_bundle['config'] else app_bundle['config'],
                         'app_device_type__app_version_number_id': app_bundle['app_device_type__app_version_number_id'],
                     })
             dvr_list = [app_bundle for app_bundle in app_bundle_list if app_bundle['model'] == 1]

+ 1 - 1
Model/models.py

@@ -2866,7 +2866,7 @@ class AppDeviceType(models.Model):
     model = models.SmallIntegerField(default=0, verbose_name='设备类型')
     type = models.IntegerField(default=0, verbose_name='设备型号')
     icon = models.CharField(default='', max_length=200, verbose_name='图标文件路径')
-    config = models.JSONField(null=True, verbose_name='关联配网方式、网络频段配置json', default='')
+    config = models.JSONField(null=True, verbose_name='关联配网方式、网络频段配置json')
     app_version_number_id = models.CharField(default='', max_length=32, verbose_name='关联APP版本号表id')
 
     class Meta: