瀏覽代碼

更新数据

yf_yzl 2 年之前
父節點
當前提交
79e3a11b16
共有 1 個文件被更改,包括 6 次插入1 次删除
  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
             })