Commit 7c315e1e by HoMeTown

feat: 参考文档

parent 831bae4f
......@@ -26,15 +26,15 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
window.open(attachment.content.url)
}
const handleClickDocLink = async (docId: string) => {
const handleClickDocLink = async (documentStoreKey: string) => {
if (fromParser) {
const res = await fetchGetDocumentLink(docId)
const res = await fetchGetDocumentLink(documentStoreKey)
if (res.data) {
window.open(res.data.docUrl)
}
}
else {
window.open(docId)
window.open(documentStoreKey)
}
}
return (
......@@ -64,7 +64,7 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
</p>
<div className="flex flex-col gap-[9px]">
{ attachment.content.docList.map(doc => (
<Link className="cursor-pointer" onPress={() => handleClickDocLink(doc.documentName)} size="sm" key={doc.documentName} isExternal showAnchorIcon underline="hover">
<Link className="cursor-pointer" onPress={() => handleClickDocLink(doc.documentStoreKey)} size="sm" key={doc.documentStoreKey} isExternal showAnchorIcon underline="hover">
{doc.documentAlias}
</Link>
))}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment