修改上传限制,删掉上传后关闭的逻辑

This commit is contained in:
wzhqwq 2021-09-28 07:38:41 +08:00
父節點 26b3a50f20
當前提交 e2fb2ccc2b

查看文件

@ -34,7 +34,7 @@ export class UploadContainer extends Component {
}
handleSubmit() {
if ((this.state.msg === "" && this.file === null) || this.state.submitting) return;
if (this.file === null || this.state.submitting) return;
this.setState({ submitting: true });
localStorage.removeItem('msgTemp');
}
@ -49,9 +49,7 @@ export class UploadContainer extends Component {
return alert('提交内容失败:' + data);
}
this.setState({ submitting: false, msg: "", url: "", file: null });
alert('内容提交成功啦').then(({ isConfirmed }) => {
if (isConfirmed) window.close();
});
alert('内容提交成功啦');
});
}
}
@ -109,7 +107,7 @@ export class UploadContainer extends Component {
<button
className="btn btn-sdu btn-straight btn-upload"
onClick={this.handleSubmit}
disabled={(this.state.msg === "" && this.state.file === null) || this.state.submitting}
disabled={this.state.file === null || this.state.submitting}
>
{
this.state.submitting