diff --git a/public/react/src/forge/Index.js b/public/react/src/forge/Index.js index 6eac3cd4c..f4f512f44 100644 --- a/public/react/src/forge/Index.js +++ b/public/react/src/forge/Index.js @@ -36,7 +36,8 @@ class Index extends Component{ } componentDidMount=()=>{ let current_user={ - user_id:50207 + user_id:50207, + login:'caicc' } this.setState({ @@ -53,7 +54,7 @@ class Index extends Component{ } > - () } diff --git a/public/react/src/forge/Main/CoderRootDirectory.js b/public/react/src/forge/Main/CoderRootDirectory.js index 32e0bb413..a2ff94b40 100644 --- a/public/react/src/forge/Main/CoderRootDirectory.js +++ b/public/react/src/forge/Main/CoderRootDirectory.js @@ -1,6 +1,7 @@ import React , { Component } from 'react'; import { Dropdown , Icon , Menu , Table } from 'antd'; import {Link} from 'react-router-dom'; +import axios from 'axios'; // 点击按钮复制功能 function jsCopy(){ @@ -12,7 +13,8 @@ class CoderRootDirectory extends Component{ constructor(props){ super(props); this.state={ - address:"http" + address:"http", + ref:"master" } } @@ -22,6 +24,26 @@ class CoderRootDirectory extends Component{ }) } + componentDidMount=()=>{ + this.getProjectRoot(); + } + + getProjectRoot=(ref)=>{ + const { login } = this.props.current_user; + const { projectsId } = this.props.match.params; + + const url = `/${login}/${projectsId}/entries.json`; + axios.get((url),{ + params:{ + ref + } + }).then((result)=>{ + if(result){ + + } + }).catch((error)=>{}) + } + render(){ const menu = ( @@ -84,7 +106,7 @@ class CoderRootDirectory extends Component{ ) } - const { address } = this.state; + const { address , ref } = this.state; return(

@@ -97,7 +119,7 @@ class CoderRootDirectory extends Component{ 分支: - master + {ref}

diff --git a/public/react/src/forge/Main/Detail.js b/public/react/src/forge/Main/Detail.js index 46738b7a5..c533a48bc 100644 --- a/public/react/src/forge/Main/Detail.js +++ b/public/react/src/forge/Main/Detail.js @@ -48,12 +48,12 @@ class Detail extends Component{ - () } > - () } diff --git a/public/react/src/forge/Main/IndexItem.js b/public/react/src/forge/Main/IndexItem.js index d4eeb6075..57e0271f4 100644 --- a/public/react/src/forge/Main/IndexItem.js +++ b/public/react/src/forge/Main/IndexItem.js @@ -16,7 +16,7 @@ class IndexItem extends Component{
- {item.name} + {item.name} { item.forked_count ? { item.forked_count}:"" } { item.praises_count }