diff --git a/dsLightRag/static/ShiJi.html b/dsLightRag/static/ShiJi.html
index 7275dec4..9668eafa 100644
--- a/dsLightRag/static/ShiJi.html
+++ b/dsLightRag/static/ShiJi.html
@@ -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(() => {
// 在流处理完成后保存完整的markdown内容
localStorage.setItem('lastMarkdownContent', accumulatedContent);
- // TODO 调用接口 @app.post("/api/render_html")
- // async def render_html(request: fastapi.Request):
- // 参数:html_content=accumulatedContent
+
+ // 调用render_html接口
+ 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');
+ }
+ });
});
});
}