yf_yzl 2 anni fa
parent
commit
79e3a11b16
1 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 6 1
      smartfarming/api/views/forecast/forecast_system.py

+ 6 - 1
smartfarming/api/views/forecast/forecast_system.py

@@ -228,6 +228,11 @@ def device_photo_list(request):
             img_url = image_path + i.addr
         else:
             img_url = image_path + "/" + i.addr
+
+        if str(i.indentify_photo).startswith('/'):
+            indentify_photo = image_path + i.indentify_photo
+        else:
+            indentify_photo = image_path + "/" + i.indentify_photo
         data.append({
             "device_id":i.device_id,
             "addtime":i.addtime,
@@ -236,7 +241,7 @@ def device_photo_list(request):
             "ids":i.id,
             "mark":i.mark,
             "pest_counts":pest_counts,
-            "indentify_photo":i.indentify_photo,
+            "indentify_photo":indentify_photo,
             "indentify_result":i.indentify_result
             })