diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 76c693f6..949ffb5f 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -683,7 +683,7 @@ function CoderDepot(props){ projectDetail.license_name ? {projectDetail.license_name} : - 暂无数据,点击{setLicenseVisible(true)}}>选择并创建许可证 + {setLicenseVisible(true)}}>点击选择许可证(LICENSE) } } diff --git a/src/forge/Main/CoderRootFileDetail.js b/src/forge/Main/CoderRootFileDetail.js index 8b16f633..79177e39 100644 --- a/src/forge/Main/CoderRootFileDetail.js +++ b/src/forge/Main/CoderRootFileDetail.js @@ -162,9 +162,9 @@ class CoderRootFileDetail extends Component { }; deleteFile = () => { - const { detail } = this.props; + const { detail ,projectDetail , getDetail } = this.props; const { projectsId, owner ,branchName} = this.props.match.params; - + console.log(detail,this.props); const url = `/${owner}/${projectsId}/delete_file.json`; axios.delete(url, { params: { @@ -176,8 +176,18 @@ class CoderRootFileDetail extends Component { }) .then((result) => { if (result) { - this.props.showNotification("删除成功!"); - this.props.history.push(`/${owner}/${projectsId}`); + if(detail.path && detail.path==="LICENSE" && projectDetail){ + const url1 = `/${owner}/${projectsId}.json`; + const { name , identifier } = projectDetail; + axios.put(url1,{name,identifier,license_id:""}).then(res=>{ + getDetail && getDetail(); + this.props.showNotification("删除成功!"); + this.props.history.push(`/${owner}/${projectsId}`); + }).catch(error=>{}) + }else{ + this.props.showNotification("删除成功!"); + this.props.history.push(`/${owner}/${projectsId}`); + } } }) .catch((error) => {