diff --git a/src/forge/Main/CoderRootIndex.js b/src/forge/Main/CoderRootIndex.js
index b5d241968..7ff25dae1 100644
--- a/src/forge/Main/CoderRootIndex.js
+++ b/src/forge/Main/CoderRootIndex.js
@@ -3,7 +3,6 @@ import { Route , Switch } from 'react-router-dom';
// import Top from './DetailTop';
import Loadable from 'react-loadable';
import Loading from '../../Loading';
-import axios from 'axios';
import './Index.scss';
const FileNew = Loadable({
@@ -51,37 +50,37 @@ class CoderRootIndex extends Component{
}
}
- componentDidMount=()=>{
- this.Init();
- }
- componentDidUpdate=(prevProps)=>{
- const { location } = this.props;
- const prevlocation = prevProps && prevProps.location;
- if (location !== prevlocation) {
- this.Init();
- }
- }
+ // componentDidMount=()=>{
+ // this.Init();
+ // }
+ // componentDidUpdate=(prevProps)=>{
+ // const { location } = this.props;
+ // const prevlocation = prevProps && prevProps.location;
+ // if (location !== prevlocation) {
+ // this.Init();
+ // }
+ // }
- Init=()=>{
- const { branchName } = this.props.match.params;
- const { defaultBranch } = this.props;
- this.getTopCount(branchName || defaultBranch);
- }
+ // Init=()=>{
+ // const { branchName } = this.props.match.params;
+ // const { defaultBranch } = this.props;
+ // this.getTopCount(branchName || defaultBranch);
+ // }
// 获取组件里要显示的数据
- getTopCount=(branch)=>{
- const { projectsId , owner } = this.props.match.params;
- const url = `/${owner}/${projectsId}/top_counts.json`;
- axios.get(url,{params:{
- ref:branch
- }}).then(result=>{
- if(result){
- this.setState({
- coderCount:result.data
- })
- }
- }).catch(error=>{console.log(error);})
- }
+ // getTopCount=(branch)=>{
+ // const { projectsId , owner } = this.props.match.params;
+ // const url = `/${owner}/${projectsId}/top_counts.json`;
+ // axios.get(url,{params:{
+ // ref:branch
+ // }}).then(result=>{
+ // if(result){
+ // this.setState({
+ // coderCount:result.data
+ // })
+ // }
+ // }).catch(error=>{console.log(error);})
+ // }
render(){
return(
@@ -100,12 +99,12 @@ class CoderRootIndex extends Component{
>
()
+ (props) => ()
}
>
()
+ () => ()
}
>
()
+ () => ()
}
>
{/* span{
padding-left: 15px;
diff --git a/src/forge/Newfile/UserSubmitComponent.js b/src/forge/Newfile/UserSubmitComponent.js
index 84ae9b33e..aa4bba6e9 100644
--- a/src/forge/Newfile/UserSubmitComponent.js
+++ b/src/forge/Newfile/UserSubmitComponent.js
@@ -83,8 +83,7 @@ class UserSubmitComponent extends Component {
if (result.data && result.data.name) {
this.props.showNotification("文件新建成功!");
if(submitType === "1"){
- const { getTopCount , getDetail } = this.props;
- getTopCount && getTopCount(values.branchname);
+ const { getDetail } = this.props;
getDetail && getDetail();
}
let url = `/${owner}/${projectsId}${values.branchname ? `/tree/${turnbar(values.branchname)}`: (branch ? `/tree/${turnbar(branch)}` : "")}`;