Merge pull request '项目首页-精选项目-固定八个组织的logo信息' (#307) from caishi/forgeplus-react:gitlink_server into gitlink_server

This commit is contained in:
xxq250 2021-12-02 17:30:42 +08:00
commit 7d4def6056
1 changed files with 32 additions and 24 deletions

View File

@ -23,27 +23,41 @@ const settings = {
autoplay:true,
arrows:false
};
const group_size = 6;
// const group_size = 6;
const list =[
[
{url:"/Huawei_Technology",avatar_url:huawei,name:"华为技术有限公司"},
{url:"/openatom_foundation",avatar_url:jijinhui,name:"开放原子开源基金会"},
{url:"/Inspur",avatar_url:langchao,name:"浪潮信息"},
{url:"/mulan-community",avatar_url:mulan,name:"木兰开源社区"},
],
[
{url:"/CrowdOS_WeSense",avatar_url:xigongye,name:"西北工业大学"},
{url:"/pkecosystem",avatar_url:feiteng,name:"PK开源生态项目组"},
{url:"/xuos",avatar_url:xiuos,name:"泛在操作系统实验室"},
{url:"/hustos",avatar_url:huake,name:"华中科技大学操作系统团队"},
]
]
function SubUnitBanner() {
const [ list , setlist ] = useState(undefined);
// const [ list , setlist ] = useState(undefined);
useEffect(()=>{
getRecommandOrz();
},[])
// useEffect(()=>{
// getRecommandOrz();
// },[])
function getRecommandOrz(params) {
const url = `/organizations/recommend.json`;
axios.get(url,{
params:{
group_size
}
}).then(result=>{
if(result){
setlist(result.data.organizations)
}
}).catch(error=>{})
}
// function getRecommandOrz(params) {
// const url = `/organizations/recommend.json`;
// axios.get(url,{
// params:{
// group_size
// }
// }).then(result=>{
// if(result){
// setlist(result.data.organizations)
// }
// }).catch(error=>{})
// }
return(
list && list.length > 0 ?
<div className="unitBanner">
@ -60,7 +74,7 @@ function SubUnitBanner() {
{
i.map((j,k1)=>{
return(
<Link to={j.name}><img src={getImageUrl(`/${j.avatar_url}`)} alt="" height="56px" style={{maxWidth:"180px"}}/></Link>
<Link to={j.url}><img src={j.avatar_url} title={j.name} alt={j.name} height="56px" style={{maxWidth:"180px"}}/></Link>
)
})
}
@ -68,12 +82,6 @@ function SubUnitBanner() {
)
})
}
{/* <div className="slickline">
<a href="https://www.nwpu.edu.cn/" target="_blank"><img src={xigongye} alt="" height="56px"/></a>
<a href="https://www.phytium.com.cn/" target="_blank"><img src={feiteng} alt="" height="56px"/></a>
<a href="http://xuos.io" target="_blank"><img src={xiuos} alt="" height="56px"/></a>
<a href="https://www.hust.edu.cn/" target="_blank"><img src={huake} alt="" height="56px"/></a>
</div> */}
</Slider>
</div>
</div>