From ce265b9b208f84a6934d3826b98abe9de45eb33b Mon Sep 17 00:00:00 2001 From: Linzp Date: Wed, 28 Jan 2026 13:30:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6=E4=B8=8D?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E6=97=B6=E6=8A=A5=E9=94=99=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=B4=A9=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/components/FilePreview/typeFormat.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index acf930a..18af09e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kne/react-file", - "version": "0.1.32", + "version": "0.1.33", "description": "提供了文件上传,文件预览,文件批量管理等功能", "syntax": { "esmodules": true diff --git a/src/components/FilePreview/typeFormat.js b/src/components/FilePreview/typeFormat.js index a1f4c33..b6d07e5 100644 --- a/src/components/FilePreview/typeFormat.js +++ b/src/components/FilePreview/typeFormat.js @@ -9,6 +9,9 @@ import VideoPreview from './VideoPreview'; import MarkdownPreview from './MarkdownPreview'; const typeFormat = url => { + if (typeof url !== 'string') { + return 'unknown'; + } const path = (url || '').split('?')[0]; const _path = path.toLowerCase(); if (/.txt$/.test(_path)) {