forked from Gitlink/forgeplus-react
上传失败结束loading效果
This commit is contained in:
parent
f40aa56f92
commit
cbce5d10cd
|
|
@ -30,11 +30,11 @@ function UploadImage({ getImage , url, getImageId, maxSize = 2, action = getUplo
|
||||||
if (!isLt2M) {
|
if (!isLt2M) {
|
||||||
message.error(`上传的图片不能超过${maxSize}MB!`);
|
message.error(`上传的图片不能超过${maxSize}MB!`);
|
||||||
}
|
}
|
||||||
|
isJpgOrPng && isLt2M && setLoading(true);
|
||||||
return isJpgOrPng && isLt2M;
|
return isJpgOrPng && isLt2M;
|
||||||
}
|
}
|
||||||
// 上传完成后
|
// 上传完成后
|
||||||
function handleChange(info){
|
function handleChange(info){
|
||||||
setLoading(true);
|
|
||||||
if(info && info.file && info.file.status === "done"){
|
if(info && info.file && info.file.status === "done"){
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
getImageId && getImageId(info.file.response.id);
|
getImageId && getImageId(info.file.response.id);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue