From f5c9e426c9bf99df78a57e86f55ced39eadf13a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=97=E6=9E=B3?= <7854742+wang_rumeng@user.noreply.gitee.com> Date: Tue, 12 Aug 2025 21:15:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=BE=E7=89=87=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E9=80=BB=E8=BE=91=EF=BC=8C=E7=A1=AE=E4=BF=9D=E5=9C=A8?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E9=80=89=E6=8B=A9=E5=92=8C=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E5=A4=B1=E8=B4=A5=E6=97=B6=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=B8=8A=E4=BC=A0=E7=8A=B6=E6=80=81=EF=BC=8C?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E5=9C=A8=E6=96=87=E4=BB=B6=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E5=90=8E=E8=AE=BE=E7=BD=AE=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=B8=BA=E7=9C=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ui/character-tab-content.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/ui/character-tab-content.tsx b/components/ui/character-tab-content.tsx index 6720792..09f7fa9 100644 --- a/components/ui/character-tab-content.tsx +++ b/components/ui/character-tab-content.tsx @@ -212,19 +212,23 @@ export function CharacterTabContent({ }; const handleUploadClick = () => { - setIsUploading(true); fileInputRef.current?.click(); }; const handleFileChange = (event: React.ChangeEvent) => { const file = event.target.files?.[0]; - if (!file) return; + if (!file) { + setIsUploading(false); + return; + }; // 检查文件类型 if (!file.type.startsWith('image/')) { alert('请选择图片文件'); + setIsUploading(false); return; } + setIsUploading(true); uploadImageToQiniu(file).then((data) => { console.log('上传图片成功', data);