From 43e9c90439890056c94a2265296bda2626aef447 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Tue, 18 Feb 2020 14:56:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=8E=E5=88=86=E6=94=AF=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E5=88=B0=E5=88=86=E6=94=AF=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- public/react/src/forge/Main/CoderRootBranch.js | 3 ++- public/react/src/forge/Main/CoderRootCommit.js | 12 +++++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index aa06fcaf5..f21667b0f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -329,7 +329,7 @@ class ApplicationController < ActionController::Base def current_user # User.current if Rails.env.development? - user_id = 36390 + user_id = 50207 else user_id = 130328 end diff --git a/public/react/src/forge/Main/CoderRootBranch.js b/public/react/src/forge/Main/CoderRootBranch.js index 79c75e85e..baa51d71d 100644 --- a/public/react/src/forge/Main/CoderRootBranch.js +++ b/public/react/src/forge/Main/CoderRootBranch.js @@ -15,6 +15,7 @@ class CoderRootBranch extends Component { render(){ const { branchList, projectDetail } = this.props; + const { projectsId } = this.props.match.params; const list =()=>{ if(branchList && branchList.length>0){ return( @@ -24,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 8aedb4451..bea5229c3 100644 --- a/public/react/src/forge/Main/CoderRootCommit.js +++ b/public/react/src/forge/Main/CoderRootCommit.js @@ -19,11 +19,21 @@ 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(branch , page , limit); + this.getCommitList( branchName || branch , page , limit ); } getCommitList=(branch , page , limit)=>{