diff --git a/public/react/src/forge/Main/CoderRootDirectory.js b/public/react/src/forge/Main/CoderRootDirectory.js index 2817579b3..34b0478c7 100644 --- a/public/react/src/forge/Main/CoderRootDirectory.js +++ b/public/react/src/forge/Main/CoderRootDirectory.js @@ -30,7 +30,7 @@ class CoderRootDirectory extends Component{ http_url:undefined, subFileType:"", readMeContent:undefined, - + isSpin:true, branchList:undefined, @@ -64,7 +64,8 @@ class CoderRootDirectory extends Component{ getProjectRoot=(branch)=>{ const { current_user } = this.props; const { projectsId } = this.props.match.params; - const url = `/${current_user && current_user.login}/${projectsId}/entries.json`; + const { state } = this.props.history.location; + const url = `/${state}/${projectsId}/entries.json`; axios.get((url),{ params:{ branch @@ -83,7 +84,7 @@ class CoderRootDirectory extends Component{ rootData:result.data }) } - + }).catch((error)=>{}) } @@ -128,7 +129,7 @@ class CoderRootDirectory extends Component{ const { branch } = this.state; const { state } = this.props.history.location; - + const url =`/${state}/${projectsId}/sub_entries.json`; axios.get(url,{ @@ -183,7 +184,7 @@ class CoderRootDirectory extends Component{
{readMeContent[0].name}
{ - readMeContent[0].content ? + readMeContent[0].content ?
: 暂无~ @@ -197,7 +198,7 @@ class CoderRootDirectory extends Component{ // 选择分支 changeBranch=(value)=>{ const { branchList } = this.props; - + let branchLastCommit = branchList && branchList.length >0 && branchList[parseInt(value.key)]; this.setState({ branch:branchLastCommit.name, @@ -255,13 +256,13 @@ class CoderRootDirectory extends Component{ ) } - } + } const urlRoot = filePath && filePath.length > 0 ? `/${filePath[filePath.length - 1].path}` : ""; return( { - rootData && + rootData && { rootData.length > 0 ? @@ -288,10 +289,10 @@ class CoderRootDirectory extends Component{ ) }) } - + } - +
{ @@ -330,4 +331,4 @@ class CoderRootDirectory extends Component{ ) } } -export default CoderRootDirectory; \ No newline at end of file +export default CoderRootDirectory;