forked from Gitlink/forgeplus-react
entries接口传的branch值为undefined
This commit is contained in:
parent
e4c54622b8
commit
9cfe2c186e
|
@ -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){
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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={
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue