From 4cc2458cc0ad2fba95cee49a3a2ede2deeba19f3 Mon Sep 17 00:00:00 2001 From: HuangHai <10402852@qq.com> Date: Sun, 13 Jul 2025 10:18:23 +0800 Subject: [PATCH] 'commit' --- dsLightRag/static/ShiJi.html | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) 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'); + } + }); }); }); }