许可证-issue

This commit is contained in:
caishi 2025-03-13 11:31:40 +08:00
parent 2997ff8517
commit bd736ef09f
2 changed files with 15 additions and 5 deletions

View File

@ -683,7 +683,7 @@ function CoderDepot(props){
projectDetail.license_name ?
<Link to={`/${owner}/${projectsId}/tree/${turnbar(branchName || defaultBranch)}/LICENSE`} className="color-grey-6">{projectDetail.license_name}</Link>
:
<span>暂无数据点击<a className='color-blue' onClick={()=>{setLicenseVisible(true)}}>选择并创建许可证</a></span>
<a className='color-blue' onClick={()=>{setLicenseVisible(true)}}>点击选择许可证(LICENSE)</a>
}
</div>
}

View File

@ -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) => {