diff --git a/spug_web/src/pages/deploy/request/Ext2Form.js b/spug_web/src/pages/deploy/request/Ext2Form.js index 43af554..4c25bd2 100644 --- a/spug_web/src/pages/deploy/request/Ext2Form.js +++ b/spug_web/src/pages/deploy/request/Ext2Form.js @@ -70,8 +70,6 @@ class Ext2Form extends React.Component { handleUploadChange = (v) => { if (v.fileList.length === 0) { this.setState({fileList: []}) - } else { - this.setState({fileList: [v.file]}) } }; @@ -81,7 +79,10 @@ class Ext2Form extends React.Component { formData.append('file', file); formData.append('deploy_id', store.record.deploy_id); http.post('/api/deploy/request/upload/', formData) - .then(res => file.path = res) + .then(res => { + file.path = res; + this.setState({fileList: [file]}) + }) .finally(() => this.setState({uploading: false})) return false }; @@ -113,7 +114,7 @@ class Ext2Form extends React.Component {