diff --git a/src/forge/Branch/CloneAddress.js b/src/forge/Branch/CloneAddress.js
index c2e6dd74..b3e31ccc 100644
--- a/src/forge/Branch/CloneAddress.js
+++ b/src/forge/Branch/CloneAddress.js
@@ -7,10 +7,10 @@ function CloneAddress({http_url , ssh_url , zip_url , tar_url}) {
const [ key , setKey ] = useState("HTTP");
return (
-
)
diff --git a/src/forge/Component/Contributors.jsx b/src/forge/Component/Contributors.jsx
index e88acc05..f6dade6a 100644
--- a/src/forge/Component/Contributors.jsx
+++ b/src/forge/Component/Contributors.jsx
@@ -7,7 +7,7 @@ import './Component.scss';
import { getUser } from '../GetData/getData';
import axios from 'axios';
-function Contributors({contributors,owner,projectsId,currentLogin}){
+function Contributors({owner,projectsId,currentLogin}){
const [ menuList ,setMenuList ]= useState([]);
const [ list , setList ]= useState(undefined);
const [ total , setTotal ]= useState(0);
@@ -16,11 +16,18 @@ function Contributors({contributors,owner,projectsId,currentLogin}){
const [ isSpin , setIsSpin ] = useState(false);
useEffect(()=>{
- if(contributors && contributors.total_count>0){
- setTotal(contributors.total_count);
- setList(contributors.list);
- }
- },[contributors])
+ getData();
+ },[])
+
+ function getData(){
+ const url = `/${owner}/${projectsId}/contributors.json`;
+ axios.get(url).then(result=>{
+ if(result){
+ setTotal(result.data.total_count);
+ setList(result.data.list);
+ }
+ }).catch(error=>{})
+ }
useEffect(()=>{
if(login){
@@ -148,15 +155,15 @@ function Contributors({contributors,owner,projectsId,currentLogin}){
}
return(
+ total > 0 ?
贡献者
- { contributors && contributors.total_count > 0 &&
{contributors.total_count}}
+ { total > 0 &&
{total}}
setVisibleFunc(false)}>
{
- total > 0 ?
- list.map((item,key)=>{
+ list && list.length>0 && list.map((item,key)=>{
return(
@@ -165,10 +172,9 @@ function Contributors({contributors,owner,projectsId,currentLogin}){
)
})
- :""
}
-
+
:""
)
}
export default Contributors;
\ No newline at end of file
diff --git a/src/forge/Component/LanguagePower.jsx b/src/forge/Component/LanguagePower.jsx
index 8d3e361b..b2fb174b 100644
--- a/src/forge/Component/LanguagePower.jsx
+++ b/src/forge/Component/LanguagePower.jsx
@@ -1,18 +1,41 @@
import React, { useEffect, useState } from 'react';
import { FlexAJ } from '../Component/layout';
+import { Divider } from 'antd';
+import axios from 'axios';
-function LanguagePower({languages}){
+function LanguagePower({owner,projectsId}){
const [ array , setArray ] = useState(undefined);
+
useEffect(()=>{
- if(languages){
- let arr = [];
- Object.keys(languages).map((item,key)=>{
- arr.push({name:item,percent:languages[item],color:getColor()});
- })
- setArray(arr);
- }
- },[languages])
+ getData();
+ },[])
+
+ function getData(){
+ const url = `/${owner}/${projectsId}/languages.json`;
+ axios.get(url).then(result=>{
+ if(result){
+ let languages = result.data;
+ if(languages){
+ let arr = [];
+ Object.keys(languages).map((item,key)=>{
+ arr.push({name:item,percent:languages[item],color:getColor()});
+ })
+ setArray(arr);
+ }
+ }
+ }).catch(error=>{})
+ }
+
+ // useEffect(()=>{
+ // if(languages){
+ // let arr = [];
+ // Object.keys(languages).map((item,key)=>{
+ // arr.push({name:item,percent:languages[item],color:getColor()});
+ // })
+ // setArray(arr);
+ // }
+ // },[languages])
function getColor(){
let str = "#";
@@ -24,7 +47,9 @@ function LanguagePower({languages}){
return str;
}
return(
+ (array && array.length > 0) ?