entries接口传的branch值为undefined

This commit is contained in:
caishi 2021-04-07 18:44:20 +08:00
parent bcaec7a2db
commit 2f595d750a
4 changed files with 6 additions and 7 deletions

View File

@ -47,7 +47,6 @@ function CoderDepot(props){
const projectsId = props.match.params.projectsId;
const branchName = props.match.params.branchName;
let pathname = props.history.location.pathname;
useEffect(()=>{
if(props.projectDetail){
setProjectDetail(props.projectDetail);
@ -65,17 +64,17 @@ function CoderDepot(props){
},[treeValue])
useEffect(()=>{
if (pathname){
if (pathname && projectDetail){
if(pathname.indexOf(`/projects/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${branchName}/`) > -1) {
let url = pathname.split(`/tree/${branchName}/`)[1];
setTreeValue(url);
getFileInfo(url,branchName);
}else{
setTreeValue(undefined);
getDirInfo(branchName ||(projectDetail && projectDetail.default_branch));
getDirInfo(branchName ||projectDetail.default_branch);
}
}
},[pathname])
},[pathname,projectDetail])
//
function getDirInfo(branch){

View File

@ -139,7 +139,7 @@ export default Form.create()(
}
return (
<Spin spinning={isSpin}>
<WhiteBack className="mb30" style={{border:"1px solid #eee"}}>
<WhiteBack className="mb30">
<Banner>{groupId ? "基本设置" : "新建团队"}</Banner>
<Div>
<Form>

View File

@ -78,7 +78,7 @@ function Detail(props){
detail &&
<Cards
src={`/organize/${detail.name}`}
title={detail.nickname}
title={detail.name}
desc={!buttonflag && detail.description}
img={detail.avatar_url}
rightBtn={

View File

@ -56,7 +56,7 @@ export default ((props)=>{
detail &&
<Cards
src={`/organize/${OIdentifier}/group/${groupId}`}
title={detail.nickname}
title={detail.nickname||detail.name}
rightBtn={
flag && <span className="subNavs">
<Link to={`/organize/${OIdentifier}/member`} className={pathname ===`/organize/${OIdentifier}/member` ? "active":""}><span>组织成员</span>{detail.num_users && <lable>{detail.num_users}</lable>}</Link>