diff --git a/src/forge/Order/order_form.js b/src/forge/Order/order_form.js index e1ae9a671..e3a2eb912 100644 --- a/src/forge/Order/order_form.js +++ b/src/forge/Order/order_form.js @@ -81,10 +81,10 @@ class order_form extends Component { if (result) { let data ={ branch_name: result.data.branch_name, - issue_tag_ids: [ + issue_tag_ids: result.data.issue_tags && result.data.issue_tags[0].id ? - String(result.data.issue_tags[0].id) : "", - ], + String(result.data.issue_tags[0].id) : "" + , fixed_version_id: result.data.fixed_version_id ? String(result.data.fixed_version_id) : "", tracker_id: result.data.tracker_id ? String(result.data.tracker_id) : "", issue_type: result.data.issue_type, diff --git a/src/forge/Upload/Index.js b/src/forge/Upload/Index.js index 713803aa3..f34888bbe 100644 --- a/src/forge/Upload/Index.js +++ b/src/forge/Upload/Index.js @@ -61,10 +61,13 @@ class Index extends Component { handleChange = (info) => { const { changeIsComplete } = this.props; changeIsComplete && changeIsComplete(true); - if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { - let fileList = info.fileList; - this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) }); - this.fileIdList(fileList); + const file = info.file; + if(file && file.type){ + if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { + let fileList = info.fileList; + this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) }); + this.fileIdList(fileList); + } } } @@ -77,6 +80,10 @@ class Index extends Component { } beforeUpload = (file) => { + if(file && !file.type){ + this.props.showNotification(`不能上传文件夹!`); + return; + } const { size } = this.props; const isLt100M = file.size / 1024 / 1024 < size; if (!isLt100M) { diff --git a/src/forge/Upload/attachment.js b/src/forge/Upload/attachment.js index 9918363df..677b48ee8 100644 --- a/src/forge/Upload/attachment.js +++ b/src/forge/Upload/attachment.js @@ -138,6 +138,7 @@ class Attachment extends Component { to={`${item.url}`} target="_blank" className="attachment-list-a" + download > {item.title}