From 52797d021ee0de5c1f7c9268cceda40e44c33024 Mon Sep 17 00:00:00 2001 From: vapao Date: Sun, 16 Aug 2020 12:19:04 +0800 Subject: [PATCH] =?UTF-8?q?U=20=E4=BC=98=E5=8C=96=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=8F=91=E5=B8=83=E7=94=B3=E8=AF=B7=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_web/src/pages/deploy/request/Ext2Form.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 { - {fileList.length === 0 ? : null} + {fileList.length === 0 ? : null}