From 2dc4a7392eef26fdadd00fde1baf8b471ab25ca5 Mon Sep 17 00:00:00 2001
From: xuyonghao <898441624@qq.com>
Date: 星期二, 17 十二月 2024 15:16:44 +0800
Subject: [PATCH] user_app表app补全注册接口

---
 app/api/excel.py |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/app/api/excel.py b/app/api/excel.py
index 2d6a35f..77ae5fd 100644
--- a/app/api/excel.py
+++ b/app/api/excel.py
@@ -56,8 +56,7 @@
         if file.filename == '':
             return JSONResponse(content={"error": "娌℃湁閫夋嫨鏂囦欢"}, status_code=400)
         if file and allowed_file(file.filename):
-            filename = secure_filename(file.filename)
-            save_path = os.path.join(SOURCE_FILES_PATH, filename)
+            save_path = os.path.join(SOURCE_FILES_PATH, file.filename)
             with open(save_path, 'wb') as buffer:
                 shutil.copyfileobj(file.file, buffer)
             save_path_list.append(save_path)
@@ -73,16 +72,12 @@
 
     create_dir_if_not_exists(SOURCE_FILES_PATH)
     create_dir_if_not_exists(EXCEL_FILES_PATH)
-    clear_directory(SOURCE_FILES_PATH)
-    clear_directory(EXCEL_FILES_PATH)
 
     while True:
         data = await websocket.receive_text()
         try:
             if data == "\"鍚堝苟Excel\"":
-                clear_directory(EXCEL_FILES_PATH)
                 output_file_path = run_conformity()
-                clear_directory(EXCEL_FILES_PATH)
                 output_file_path = run_conformity()
                 files = os.listdir(EXCEL_FILES_PATH)
                 if files:
@@ -90,7 +85,7 @@
                     file_name = os.path.basename(first_file)
                     file_url = f"./api/document/download/{first_file}"
                     await websocket.send_json({
-                        "step_message": "鏂囨。鍚堝苟鎴愬姛锛�",
+                        "message": "鏂囨。鍚堝苟鎴愬姛锛�",
                         "type": "stream",
                         "files": [{
                             "file_name": file_name,
@@ -98,7 +93,7 @@
                         }]
                     })
                     await websocket.send_json({
-                        "step_message": "",
+                        "message": "鏂囨。鍚堝苟鎴愬姛锛�",
                         "type": "close",
                     })
                 else:

--
Gitblit v1.8.0