add res for upload

This commit is contained in:
yiminghe 2015-08-27 16:53:53 +08:00
parent 3cc4a374db
commit 97ac458507

View File

@ -31,13 +31,15 @@ const AntUpload = React.createClass({
this.props.onStart(file); this.props.onStart(file);
}, },
onSuccess(ret, file) { onSuccess(ret, file) {
var res = this.props.onSuccess(ret, file);
if (res !== false) {
Message.success(file.name + '上传完成'); Message.success(file.name + '上传完成');
let targetItem = getFileItem(file, this.state.downloadList); let targetItem = getFileItem(file, this.state.downloadList);
targetItem.status = 'done'; targetItem.status = 'done';
this.setState({ this.setState({
downloadList: this.state.downloadList downloadList: this.state.downloadList
}); });
this.props.onSuccess(ret, file); }
}, },
onProgress(e, file) { onProgress(e, file) {
this.props.onProgress(e, file); this.props.onProgress(e, file);