|
|
@ -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');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|