修改上传限制,删掉上传后关闭的逻辑
This commit is contained in:
父節點
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
|
||||
|
載入中…
x
新增問題並參考
Block a user