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);