fix:pdf_path

This commit is contained in:
zty 2024-05-08 09:06:47 +08:00
parent c5e116a6d1
commit a59d2c16a7
1 changed files with 2 additions and 1 deletions

View File

@ -377,7 +377,8 @@ class ParsePdfViewSet(RbacFilterSet, CreateUpdateCustomMixin, ModelViewSet):
os.makedirs(media_excel)
shutil.copy(EXCEL_PATH, media_excel)
save_path = os.path.join(media_excel, os.path.basename(EXCEL_PATH))
run(pdf_file, save_path)
server_pdf_path = os.path.join(settings.BASE_DIR, pdf_file)
run(server_pdf_path, save_path)
except Exception:
traceback.print_exc()
return Response({"message":"解析失败"}, status = status.HTTP_400_BAD_REQUEST)