瀏覽代碼

ota_完善文件删除功能_2

locky 4 年之前
父節點
當前提交
2cef9c75a8
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Controller/EquipmentOTA.py

+ 1 - 1
Controller/EquipmentOTA.py

@@ -75,7 +75,7 @@ class EquipmentOTA(View):
             return response.json(173)
         try:
             # 删除文件和相应数据
-            file_path = equipment_version[0]['filePath']
+            file_path = '/'.join(BASE_DIR, equipment_version[0]['filePath']).replace('\\', '/')
             os.remove(file_path)
             equipment_version.delete()
         except Exception as e: