entries接口传的branch值为undefined
This commit is contained in:
parent
bcaec7a2db
commit
2f595d750a
|
@ -47,7 +47,6 @@ function CoderDepot(props){
|
||||||
const projectsId = props.match.params.projectsId;
|
const projectsId = props.match.params.projectsId;
|
||||||
const branchName = props.match.params.branchName;
|
const branchName = props.match.params.branchName;
|
||||||
let pathname = props.history.location.pathname;
|
let pathname = props.history.location.pathname;
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(props.projectDetail){
|
if(props.projectDetail){
|
||||||
setProjectDetail(props.projectDetail);
|
setProjectDetail(props.projectDetail);
|
||||||
|
@ -65,17 +64,17 @@ function CoderDepot(props){
|
||||||
},[treeValue])
|
},[treeValue])
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if (pathname){
|
if (pathname && projectDetail){
|
||||||
if(pathname.indexOf(`/projects/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${branchName}/`) > -1) {
|
if(pathname.indexOf(`/projects/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${branchName}/`) > -1) {
|
||||||
let url = pathname.split(`/tree/${branchName}/`)[1];
|
let url = pathname.split(`/tree/${branchName}/`)[1];
|
||||||
setTreeValue(url);
|
setTreeValue(url);
|
||||||
getFileInfo(url,branchName);
|
getFileInfo(url,branchName);
|
||||||
}else{
|
}else{
|
||||||
setTreeValue(undefined);
|
setTreeValue(undefined);
|
||||||
getDirInfo(branchName ||(projectDetail && projectDetail.default_branch));
|
getDirInfo(branchName ||projectDetail.default_branch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},[pathname])
|
},[pathname,projectDetail])
|
||||||
|
|
||||||
// 获取主目录列表
|
// 获取主目录列表
|
||||||
function getDirInfo(branch){
|
function getDirInfo(branch){
|
||||||
|
|
|
@ -139,7 +139,7 @@ export default Form.create()(
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Spin spinning={isSpin}>
|
<Spin spinning={isSpin}>
|
||||||
<WhiteBack className="mb30" style={{border:"1px solid #eee"}}>
|
<WhiteBack className="mb30">
|
||||||
<Banner>{groupId ? "基本设置" : "新建团队"}</Banner>
|
<Banner>{groupId ? "基本设置" : "新建团队"}</Banner>
|
||||||
<Div>
|
<Div>
|
||||||
<Form>
|
<Form>
|
||||||
|
|
|
@ -78,7 +78,7 @@ function Detail(props){
|
||||||
detail &&
|
detail &&
|
||||||
<Cards
|
<Cards
|
||||||
src={`/organize/${detail.name}`}
|
src={`/organize/${detail.name}`}
|
||||||
title={detail.nickname}
|
title={detail.name}
|
||||||
desc={!buttonflag && detail.description}
|
desc={!buttonflag && detail.description}
|
||||||
img={detail.avatar_url}
|
img={detail.avatar_url}
|
||||||
rightBtn={
|
rightBtn={
|
||||||
|
|
|
@ -56,7 +56,7 @@ export default ((props)=>{
|
||||||
detail &&
|
detail &&
|
||||||
<Cards
|
<Cards
|
||||||
src={`/organize/${OIdentifier}/group/${groupId}`}
|
src={`/organize/${OIdentifier}/group/${groupId}`}
|
||||||
title={detail.nickname}
|
title={detail.nickname||detail.name}
|
||||||
rightBtn={
|
rightBtn={
|
||||||
flag && <span className="subNavs">
|
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>
|
<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