修复xlsx工作流某些后缀不能使用的问题

This commit is contained in:
xunbu
2025-09-23 11:08:00 +08:00
parent f88a7657b9
commit 493a0b847a
2 changed files with 3 additions and 3 deletions

View File

@@ -160,7 +160,7 @@ async def lifespan(app: FastAPI):
global_logger.propagate = False global_logger.propagate = False
global_logger.setLevel(logging.INFO) global_logger.setLevel(logging.INFO)
print("应用启动完成,多任务状态已初始化。") print("应用启动完成,多任务状态已初始化。")
print(f"服务接口文档: http://12ent.0.0.1:{app.state.port_to_use}/docs") print(f"服务接口文档: http://127.0.0.1:{app.state.port_to_use}/docs")
print(f"请用浏览器访问 http://127.0.0.1:{app.state.port_to_use}\n") print(f"请用浏览器访问 http://127.0.0.1:{app.state.port_to_use}\n")
yield yield
# 清理任何可能残留的临时目录 # 清理任何可能残留的临时目录
@@ -1506,7 +1506,7 @@ async def service_content(
file_info = task_state.get("downloadable_files", {}).get(file_type) file_info = task_state.get("downloadable_files", {}).get(file_type)
if not file_info or not os.path.exists(file_info.get("path")): if not file_info or not os.path.exists(file_info.get("path")):
raise HTTPException(status_code=404, raise HTTPException(status_code=404,
detail=f"任务 '{task_id}' 不支持获取 '{file_type}' 类型内容,或文件已丢失。") detail=f"任务 '{task_id}' 不支持获取 '{file_type}' 类型内容,或文件已丢失。")
file_path = file_info["path"] file_path = file_info["path"]
filename = file_info["filename"] filename = file_info["filename"]

View File

@@ -44,7 +44,7 @@ class XlsxWorkflow(Workflow[XlsxWorkflowConfig, Document, Document], HTMLExporta
def _get_document_xlsx(self, document: Document) -> Document: def _get_document_xlsx(self, document: Document) -> Document:
suffix = document.suffix suffix = document.suffix
converter_types = self._converter_factory.get(suffix) converter_types = self._converter_factory.get(suffix.lower())
if converter_types is None: if converter_types is None:
raise ValueError(f"Xlsx工作流不支持{suffix}格式文件") raise ValueError(f"Xlsx工作流不支持{suffix}格式文件")
converter_type, converter_config = converter_types converter_type, converter_config = converter_types