From d191f0b8174e5a76958ba5a17a81e777677af722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 7 Jan 2020 15:09:40 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RepositoryAddFileupload_file.js | 32 ++++++++++++------- .../shixunchild/Repository/Repositoryfile.js | 15 ++++----- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js index 72bc9bf8c..fe060835b 100644 --- a/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js +++ b/public/react/src/modules/tpm/shixunchild/Repository/RepositoryAddFileupload_file.js @@ -29,17 +29,19 @@ class RepositoryAddFileupload_files extends Component { } handleChange = (info) => { - - if (info.file.status === 'done') { + console.log(info) + if (info.file.status === 'done'||info.file.status === "uploading") { let fileList = [...info.fileList]; - if(info.file.response.status===-1){ - notification.open({ - message: '提示', - description:info.file.response.message, - }) - return + if(info.file.response){ + if(info.file.response.status===-1) { + notification.open({ + message: '提示', + description: info.file.response.message, + }) + return + } } fileList = fileList.slice(-2); @@ -74,9 +76,17 @@ class RepositoryAddFileupload_files extends Component { if(matchpath.indexOf("secret_repository")>-1){ Repositoryflag =true; } + + let newfilspath=filspath; + + if(newfilspath===""){ + newfilspath=info.name + }else{ + newfilspath=filspath+"/"+info.name + } const url = `/shixuns//${shixunId}/delete_git_file.json`; axios.delete(url, { data: { - path:filspath+info.name, + path:newfilspath, message:message, secret_repository:Repositoryflag }}) @@ -247,7 +257,7 @@ class RepositoryAddFileupload_files extends Component {
-