chat文件预览报500bug

This commit is contained in:
runny committed 2026-05-30 15:26:01 +08:00
1 parent a148f76217
commit 7402621ded
3 files changed
+123 -14

No files matched your search

@@ -20,6 +20,7 @@ import '@vue-office/excel/lib/index.css';
interface PreviewFile {
name: string;
url: string;
actualExt?: string;
}
interface ExcelPreviewData {
@@ -69,6 +70,8 @@ const getExt = (raw: string) => {
};
const ext = computed(() => {
const actual = getExt(props.file?.actualExt || '');
if (actual) return actual;
// Display name extension has higher priority than URL.
const byName = getExt(props.file?.name || '');
if (byName) return byName;
@@ -385,6 +388,7 @@ const loadContent = async () => {
agent_id: String(props.agentId),
url: props.file.url,
name: props.file.name || '',
ext: ext.value || '',
});
const res = await fetch(`/api/chat/preview-text?${params.toString()}`, {
headers: props.authHeaders || {},