From c2fda64b8752a2126d239e14d31c73574857667f Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Fri, 28 Feb 2020 17:53:35 +0800 Subject: [PATCH 1/3] login --- public/react/src/forge/Main/CoderRootDirectory.js | 4 ++-- public/react/src/forge/Main/Detail.js | 6 +++--- public/react/src/forge/Main/IndexItem.js | 5 ++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/public/react/src/forge/Main/CoderRootDirectory.js b/public/react/src/forge/Main/CoderRootDirectory.js index 9aa0e29a7..2817579b3 100644 --- a/public/react/src/forge/Main/CoderRootDirectory.js +++ b/public/react/src/forge/Main/CoderRootDirectory.js @@ -126,9 +126,10 @@ class CoderRootDirectory extends Component{ const { current_user } = this.props; const { projectsId } = this.props.match.params; const { branch } = this.state; + const { state } = this.props.history.location; - const url =`/${this.props&¤t_user.login}/${projectsId}/sub_entries.json`; + const url =`/${state}/${projectsId}/sub_entries.json`; axios.get(url,{ params:{ @@ -209,7 +210,6 @@ class CoderRootDirectory extends Component{ } render(){ const { rootList , branch ,filePath , fileDetail , subFileType , readMeContent, isSpin , rootData } = this.state; - console.log("ddd",rootData); const { branchLastCommit , http_url , isManager , isDeveloper } = this.props; const { projectsId } = this.props.match.params; diff --git a/public/react/src/forge/Main/Detail.js b/public/react/src/forge/Main/Detail.js index d665dbbef..45031ebc5 100644 --- a/public/react/src/forge/Main/Detail.js +++ b/public/react/src/forge/Main/Detail.js @@ -172,9 +172,9 @@ class Detail extends Component{ // } getDetail=()=>{ - const { current_user } = this.props; + const { state } = this.props.history.location; const { projectsId } = this.props.match.params; - const url = `/${current_user&¤t_user.login}/${projectsId}.json`; + const url = `/${state}/${projectsId}.json`; axios.get(url).then((result)=>{ if(result){ this.setState({ @@ -291,8 +291,8 @@ class Detail extends Component{ const url = this.props.history.location.pathname; const urlFlag = (url.split("/").length === 3); const { isManager , isDeveloper } = this.props; - const { projectsId } = this.props.match.params; + return(