Skip to content

Commit

Permalink
fix: download origin file
Browse files Browse the repository at this point in the history
  • Loading branch information
dolphin0618 committed Dec 20, 2023
1 parent fb29df8 commit f4a8c4e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export const ChatMessage = ({ chat, userName, onSource }: { chat: ChatMessageTyp
}
</div>;
case SourceType.HAS_QA:
return <p className="flex items-center text-gray-400 pb-2">本答案来源于已有问答库:{extra.qa}</p>;
return <p className="flex items-center text-gray-400 pb-2">{extra.qa}</p>;
default:
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const ResultPanne = ({ chatId, words, data, onClose, onAdd, children }: { chatId
}
{
_file.originUrl && <div className="tooltip tooltip-left" data-tip={t('chat.downloadOriginalTooltip')}>
<a href="javascript:;" onClick={(event) => { downloadFile(checkSassUrl(_file.originUrl), _file.fileName.replace(/\.[\w\d]+$/, '') + _file.originUrl.match(/(\.\w+)\?/)?.[1]); event.stopPropagation() }} >
<a href="javascript:;" onClick={(event) => { downloadFile(checkSassUrl(_file.originUrl), _file.fileName); event.stopPropagation() }} >
<Download color="rgba(53,126,249,1)" size={20} strokeWidth={1.5}></Download>
</a>
</div>
Expand Down
12 changes: 6 additions & 6 deletions src/frontend/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -722,11 +722,6 @@ export function updateTemplate(
clonedObject[key].advanced = objectToUpdate[key].advanced;
}

// L2 信息不覆盖
if (objectToUpdate[key]?.l2) {
clonedObject[key].l2 = objectToUpdate[key].l2
clonedObject[key].l2_name = objectToUpdate[key].l2_name
}
// file_path的文件类型不覆盖
if (key === 'file_path') {
clonedObject[key].fileTypes = objectToUpdate[key].fileTypes
Expand All @@ -739,7 +734,12 @@ export function updateTemplate(
if (clonedObject[key]?.show) {
clonedObject[key].show = objectToUpdate[key]?.show
}
if (clonedObject[key]?.collection_id) {
// L2 覆盖
if (objectToUpdate[key]?.l2) {
clonedObject[key].l2 = objectToUpdate[key].l2
clonedObject[key].l2_name = objectToUpdate[key].l2_name
}
if (objectToUpdate[key]?.collection_id) {
clonedObject[key].collection_id = objectToUpdate[key]?.collection_id
}
}
Expand Down

0 comments on commit f4a8c4e

Please sign in to comment.