main
HuangHai 2 weeks ago
parent 6be612fe29
commit 4cc2458cc0

@ -396,12 +396,32 @@
} }
} }
// return processChunk().then(() => {
// // 在流处理完成后保存完整的markdown内容
// localStorage.setItem('lastMarkdownContent', accumulatedContent);
// // TODO 调用接口 @app.post("/api/render_html")
// // async def render_html(request: fastapi.Request):
// // 参数html_content=accumulatedContent
// });
return processChunk().then(() => { return processChunk().then(() => {
// 在流处理完成后保存完整的markdown内容 // 在流处理完成后保存完整的markdown内容
localStorage.setItem('lastMarkdownContent', accumulatedContent); localStorage.setItem('lastMarkdownContent', accumulatedContent);
// TODO 调用接口 @app.post("/api/render_html")
// async def render_html(request: fastapi.Request): // 调用render_html接口
// 参数html_content=accumulatedContent return fetch('/api/render_html', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
html_content: accumulatedContent
})
}).then(response => response.json())
.then(data => {
if (data.url) {
window.open(data.url, '_blank');
}
});
}); });
}); });
} }

Loading…
Cancel
Save