'commit'
This commit is contained in:
@@ -70,18 +70,17 @@ async def generate_dao_xue_an(request: Request):
|
||||
|
||||
try:
|
||||
yield "data: 正在转换为Word文档...\n\n"
|
||||
# 执行Pandoc命令
|
||||
# 恢复Pandoc转换执行代码
|
||||
result = subprocess.run(
|
||||
["pandoc", temp_md_path, "-o", docx_path],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=True
|
||||
)
|
||||
|
||||
# 清理临时文件
|
||||
os.unlink(temp_md_path)
|
||||
|
||||
logger.info(f"导学案已转换为Word文档: {docx_path}")
|
||||
# 添加转换完成状态提示
|
||||
yield "data: Word文档转换完成,准备下载...\n\n"
|
||||
# 修改下载链接为静态文件路径
|
||||
yield f"data: [下载链接] /static/teacherHelpergenerated_files/{docx_filename}\n\n"
|
||||
except subprocess.CalledProcessError as e:
|
||||
|
Reference in New Issue
Block a user