Explorar el Código

ota_完善文件删除功能_2

locky hace 4 años
padre
commit
2cef9c75a8
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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: