This commit is contained in:
anph 2023-10-07 16:03:00 +08:00
parent 847cedd9bc
commit f8655d5826
2 changed files with 22 additions and 0 deletions

View File

@ -82,6 +82,17 @@ function CoderDepot(props){
const { bannerList } = props;
// const [ badges , setBadges] = useState(undefined);
// // axios
// function getBadgeData() {
// axios.get(`/${owner}/${projectsId}/badge.json`)
// .then(result => {
// if(result) {
// setBadges(result)
// }
// })
// }
// test data
const badges = {badge:[{ "login": "many_stars", "image_url": "https://www.gitlink.org.cn/system/lets/letter_avatars/2/J/236_194_58/120.png", "description": "test description1"}, {"login": "many_stars", "image_url": "https://www.gitlink.org.cn/system/lets/letter_avatars/2/X/181_166_38/120.png", "description": "test description2"}], total_count: 3}
console.log(badges.badge)

View File

@ -15,6 +15,17 @@ import Loadable from "react-loadable";
import Loading from "../../Loading";
import Badge from "../Main/sub/Badge";
//const [ badges , setBadges] = useState(undefined);
// 按照后端返回的数据格式创建的临时数据 后续改为axios
// function getBadgeData() {
// axios.get(`/${username}/statistics/badge.json`)
// .then(result => {
// if(result) {
// setBadges(result)
// }
// })
// }
//test data
const badges = {badge:[{ "login": "many_stars", "image_url": "https://testforgeplus.trustie.net//system/lets/letter_avatars/2/G/178_217_57/120.png", "description": "test description1"}, {"login": "many_stars", "image_url": "https://testforgeplus.trustie.net//images/avatars/User/36480?t=1686645429", "description": "test description2"}], total_count: 3}