diff --git a/src/forge/Main/CoderRootDirectory.js b/src/forge/Main/CoderRootDirectory.js index 40d9081d..dc8cacfa 100644 --- a/src/forge/Main/CoderRootDirectory.js +++ b/src/forge/Main/CoderRootDirectory.js @@ -20,6 +20,16 @@ import axios from "axios"; * readMeContent:根目录下面的readme文件内容 */ +function getPathUrl(array,index){ + if(array && array.length>0 && index){ + let str = ""; + for(let i=0;i { const { projectsId , owner } = this.props.match.params; //点击直接跳转页面 加载一次路由 - this.props.history.push(`/projects/${owner}/${projectsId}?url=${arr.path}`); + this.props.history.push(`/projects/${owner}/${projectsId}/coders?url=${arr.path}`); this.setState({ readOnly: readOnly, chooseType:"file" @@ -163,7 +173,7 @@ class CoderRootDirectory extends Component { const { projectsId , owner } = this.props.match.params; //点击直接跳转页面 加载一次路由 this.props.history.push( - `/projects/${owner}/${projectsId}?url=${str.substr(1)}` + `/projects/${owner}/${projectsId}/coders?url=${str.substr(1)}` ); } else { list.push({ @@ -247,7 +257,7 @@ class CoderRootDirectory extends Component { chooseType:type }) const { projectsId, owner } = this.props.match.params; - this.props.history.push(`/projects/${owner}/${projectsId}?url=${path}`); + this.props.history.push(`/projects/${owner}/${projectsId}/coders?url=${path}`); if(filename.substring(filename.length - 3) === ".md"){ this.setState({ md:true @@ -330,7 +340,7 @@ class CoderRootDirectory extends Component { readOnly:true }) const { projectsId , owner } = this.props.match.params; - this.props.history.push(`/projects/${owner}/${projectsId}?url=${url}`); + this.props.history.push(`/projects/${owner}/${projectsId}/coders?url=${url}`); } onEdit=(readOnly)=>{ @@ -357,7 +367,6 @@ class CoderRootDirectory extends Component { } title = (branchLastCommit,lastCommitAuthor) => { - console.log(branchLastCommit) if (branchLastCommit) { return (
@@ -398,6 +407,7 @@ class CoderRootDirectory extends Component { } } + render(){ const { branchLastCommit , lastCommitAuthor , rootList , branch ,filePath , fileDetail , subFileType , readMeContent, isSpin , zip_url , tar_url} = this.state; const { isManager , isDeveloper , projectDetail } = this.props; @@ -458,15 +468,14 @@ class CoderRootDirectory extends Component { > {projectDetail && projectDetail.identifier} - {array && - array.map((item, key) => { + { array && array.map((item, key) => { return ( { key === array.length-1 ? {item} : - this.returnUlr(`${key === 0 ? `${item}` :`${array[key-1]}/${item}`}`)} className="color-blue subFileName">{item} + this.returnUlr(`${getPathUrl(array,key+1)}`)} className="color-blue subFileName">{item} } ); @@ -478,13 +487,13 @@ class CoderRootDirectory extends Component { {subFileType && (projectDetail && parseInt(projectDetail.type)) !== 2 && (isManager || isDeveloper) && (
- + 上传文件 新建文件