refactor(@vben/common-ui): 优化文档生成和下载逻辑

This commit is contained in:
Kven 2025-05-06 21:06:59 +08:00
parent 80831aa367
commit 4518ef74eb

View File

@ -134,13 +134,10 @@ const startFetching = async () => {
if (answer && isDocxURL(answer)) {
filename.value = extractDocxFilename(answer);
}
fetchResult.value = `/static/${filename.value}`;
resultItems.value.push({
key: resultItems.value.length + 1,
role: 'ai',
content: res.answer,
content: '文档已生成',
footer: h(Flex, null, [
h(
Button,
@ -175,6 +172,15 @@ const startFetching = async () => {
),
]),
});
} else {
resultItems.value.push({
key: resultItems.value.length + 1,
role: 'ai',
content: res.answer,
});
}
fetchResult.value = `/static/${filename.value}`;
// resultItems.value.push({
// key: resultItems.value.length + 1,
// role: 'ai',