From 65e952bd316e9b09632a39cef846ac8f66cb7202 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Mon, 24 Feb 2020 20:54:10 +0800 Subject: [PATCH] root --- .../react/src/forge/Main/CoderRootDirectory.js | 5 +++-- public/react/src/forge/Main/CoderRootIndex.js | 1 + public/react/src/forge/Main/Detail.js | 18 +++++++++++------- .../react/src/forge/Settings/Collaborator.js | 2 +- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/public/react/src/forge/Main/CoderRootDirectory.js b/public/react/src/forge/Main/CoderRootDirectory.js index 6f4805af6..8e6e9a629 100644 --- a/public/react/src/forge/Main/CoderRootDirectory.js +++ b/public/react/src/forge/Main/CoderRootDirectory.js @@ -74,9 +74,10 @@ class CoderRootDirectory extends Component{ // 获取根目录 getProjectRoot=(branch)=>{ - //const { login } = this.props.current_user; + console.log("root",this.props); + const { current_user } = this.props; const { projectsId } = this.props.match.params; - const url = `/${this.props&&this.props.current_user.login}/${projectsId}/entries.json`; + const url = `/${current_user && current_user.login}/${projectsId}/entries.json`; axios.get((url),{ params:{ branch diff --git a/public/react/src/forge/Main/CoderRootIndex.js b/public/react/src/forge/Main/CoderRootIndex.js index dd68921cd..64550631c 100644 --- a/public/react/src/forge/Main/CoderRootIndex.js +++ b/public/react/src/forge/Main/CoderRootIndex.js @@ -26,6 +26,7 @@ const CoderRootBranch = Loadable({ class CoderRootIndex extends Component{ render(){ + console.log("index",this.props) const { projectDetail } = this.props; const { projectsId } = this.props.match.params; const { pathname } = this.props.location; diff --git a/public/react/src/forge/Main/Detail.js b/public/react/src/forge/Main/Detail.js index 7fd70ad78..e504f7693 100644 --- a/public/react/src/forge/Main/Detail.js +++ b/public/react/src/forge/Main/Detail.js @@ -85,7 +85,6 @@ class Detail extends Component{ watchers_count:undefined , praises_count:undefined , forked_count:undefined, - current_user:undefined, http_url: undefined, branchs:undefined, @@ -237,6 +236,7 @@ class Detail extends Component{ const { projectDetail , watchers_count , praises_count , forked_count , project_id } = this.state; const url = this.props.history.location.pathname; + const urlFlag = (url.split("/").length === 3); const { isManager , isDeveloper } = this.props; const { projectsId } = this.props.match.params; @@ -269,16 +269,16 @@ class Detail extends Component{
@@ -370,18 +370,22 @@ class Detail extends Component{ render={ (props) => () } + > + () + } > () } > - () + (props) => () } > - ) diff --git a/public/react/src/forge/Settings/Collaborator.js b/public/react/src/forge/Settings/Collaborator.js index d4ab6d4df..2eaa5e1d1 100644 --- a/public/react/src/forge/Settings/Collaborator.js +++ b/public/react/src/forge/Settings/Collaborator.js @@ -154,7 +154,7 @@ class Collaborator extends Component{ const source = userDataSource && userDataSource.map((item,key)=>{ return( - + ) }) return(