From d9e89e6fb7934d9e215dc1e7c7d1f61093154b9a Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Tue, 18 Feb 2020 16:12:18 +0800 Subject: [PATCH] branch --- public/react/src/forge/Main/CoderRootBranch.js | 2 +- public/react/src/forge/Main/CoderRootCommit.js | 12 +----------- public/react/src/forge/Main/CoderRootDirectory.js | 11 ++++++++++- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/public/react/src/forge/Main/CoderRootBranch.js b/public/react/src/forge/Main/CoderRootBranch.js index baa51d71d..019a6bafd 100644 --- a/public/react/src/forge/Main/CoderRootBranch.js +++ b/public/react/src/forge/Main/CoderRootBranch.js @@ -25,7 +25,7 @@ class CoderRootBranch extends Component { return(
  • - {item.name} + {item.name} {/*{item.name}*/}

    {item.last_commit && item.last_commit.id} diff --git a/public/react/src/forge/Main/CoderRootCommit.js b/public/react/src/forge/Main/CoderRootCommit.js index bea5229c3..d1afec2ed 100644 --- a/public/react/src/forge/Main/CoderRootCommit.js +++ b/public/react/src/forge/Main/CoderRootCommit.js @@ -19,21 +19,11 @@ class CoderRootCommit extends Component{ } componentDidMount=()=>{ - console.log(this.props); - let { search } = this.props.history.location; - let branchName = undefined; - if(search && search.indexOf("branch")>-1){ - branchName = search.split("=")[1]; - console.log(branchName); - this.setState({ - branch:branchName - }) - } const { branch , page , limit } = this.state; this.setState({ isSpin:true }) - this.getCommitList( branchName || branch , page , limit ); + this.getCommitList( branch , page , limit ); } getCommitList=(branch , page , limit)=>{ diff --git a/public/react/src/forge/Main/CoderRootDirectory.js b/public/react/src/forge/Main/CoderRootDirectory.js index dfe5cec09..321fb2834 100644 --- a/public/react/src/forge/Main/CoderRootDirectory.js +++ b/public/react/src/forge/Main/CoderRootDirectory.js @@ -42,7 +42,16 @@ class CoderRootDirectory extends Component{ } componentDidMount=()=>{ - this.getProjectRoot(); + let { search } = this.props.history.location; + let branchName = undefined; + if(search && search.indexOf("branch")>-1){ + branchName = search.split("=")[1]; + this.setState({ + branch:branchName + }) + } + const { branch } = this.state; + this.getProjectRoot(branchName || branch); } // 获取根目录