From bd736ef09f8a119a08923583c1a2795d9d344768 Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Thu, 13 Mar 2025 11:31:40 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AE=B8=E5=8F=AF=E8=AF=81-issue?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/forge/Main/CoderDepot.jsx | 2 +-
src/forge/Main/CoderRootFileDetail.js | 18 ++++++++++++++----
2 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx
index 76c693f6d..949ffb5fa 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 8b16f633c..79177e398 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) => {