forked from 77media/video-flow
Merge branch 'dev' of https://git.qikongjian.com/77media/video-flow into dev
This commit is contained in:
commit
f147b72db6
@ -212,19 +212,23 @@ export function CharacterTabContent({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleUploadClick = () => {
|
const handleUploadClick = () => {
|
||||||
setIsUploading(true);
|
|
||||||
fileInputRef.current?.click();
|
fileInputRef.current?.click();
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
const file = event.target.files?.[0];
|
const file = event.target.files?.[0];
|
||||||
if (!file) return;
|
if (!file) {
|
||||||
|
setIsUploading(false);
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
// 检查文件类型
|
// 检查文件类型
|
||||||
if (!file.type.startsWith('image/')) {
|
if (!file.type.startsWith('image/')) {
|
||||||
alert('请选择图片文件');
|
alert('请选择图片文件');
|
||||||
|
setIsUploading(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
setIsUploading(true);
|
||||||
|
|
||||||
uploadImageToQiniu(file).then((data) => {
|
uploadImageToQiniu(file).then((data) => {
|
||||||
console.log('上传图片成功', data);
|
console.log('上传图片成功', data);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user