chat文件预览报500bug
This commit is contained in:
1 parent
a148f76217
commit
7402621ded
3 files changed
+123
-14
No files matched your search
@@ -1,4 +1,4 @@
|
||||
|
||||
|
||||
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
@@ -186,6 +186,7 @@ interface SourceFileLink {
|
||||
url?: string;
|
||||
datasetId?: string;
|
||||
remoteDocumentId?: string;
|
||||
actualExt?: string;
|
||||
}
|
||||
|
||||
// 源文件展示配置(来自 config.ts)
|
||||
@@ -541,13 +542,14 @@ const shouldShowThinkingBubble = computed(() => {
|
||||
});
|
||||
|
||||
const filePreviewVisible = ref(false);
|
||||
const previewFile = ref<{ name: string; url: string } | null>(null);
|
||||
const previewFile = ref<{ name: string; url: string; actualExt?: string } | null>(null);
|
||||
|
||||
const resolveSourceLink = async (file: SourceFileLink): Promise<{ name: string; url: string }> => {
|
||||
const resolveSourceLink = async (file: SourceFileLink): Promise<{ name: string; url: string; actualExt?: string }> => {
|
||||
if (file.url) {
|
||||
return {
|
||||
name: file.name,
|
||||
url: file.url,
|
||||
actualExt: file.actualExt,
|
||||
};
|
||||
}
|
||||
if (!file.datasetId || !file.remoteDocumentId) {
|
||||
@@ -576,6 +578,7 @@ const resolveSourceLink = async (file: SourceFileLink): Promise<{ name: string;
|
||||
...file,
|
||||
url: resolvedUrl,
|
||||
name: data?.source_filename || file.name,
|
||||
actualExt: String(data?.source_ext || '').trim().toLowerCase() || undefined,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user