|
|
@ -94,7 +94,7 @@ async def save_to_word(request: Request):
|
|
|
|
|
|
|
|
|
|
|
|
# 使用pandoc转换
|
|
|
|
# 使用pandoc转换
|
|
|
|
output_file = os.path.join(tempfile.gettempdir(), "【理想大模型】问答.docx")
|
|
|
|
output_file = os.path.join(tempfile.gettempdir(), "【理想大模型】问答.docx")
|
|
|
|
subprocess.run(['pandoc', temp_html, '-o', output_file], check=True)
|
|
|
|
subprocess.run(['pandoc', temp_html, '-o', output_file,'--resource-path=static'], check=True)
|
|
|
|
|
|
|
|
|
|
|
|
# 读取生成的Word文件
|
|
|
|
# 读取生成的Word文件
|
|
|
|
with open(output_file, "rb") as f:
|
|
|
|
with open(output_file, "rb") as f:
|
|
|
|