From a59d2c16a7c02a66fb62fb33bba0a3894ec66cc7 Mon Sep 17 00:00:00 2001 From: zty Date: Wed, 8 May 2024 09:06:47 +0800 Subject: [PATCH] fix:pdf_path --- server/apps/information/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/apps/information/views.py b/server/apps/information/views.py index 7d90285..54623b0 100644 --- a/server/apps/information/views.py +++ b/server/apps/information/views.py @@ -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)