From 3f57e96ff49937dd3f375154038af8aa01028fe3 Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Mon, 2 Mar 2020 10:20:51 +0800 Subject: [PATCH] =?UTF-8?q?FIX=20=E4=BF=AE=E5=A4=8D=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E8=8E=B7=E5=8F=96login=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/forge/Main/CoderRootDirectory.js | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) 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;