This commit is contained in:
caishi 2023-05-17 10:22:10 +08:00
parent 3cc907f6de
commit 5b6a6b6da2
2 changed files with 17 additions and 16 deletions

View File

@ -323,7 +323,6 @@ class App extends Component {
render() {
const { pathType, pathName, mygetHelmetapi } = this.state;
console.log("dsf:",pathName);
return (
<Provider store={store}>
<ConfigProvider locale={zhCN}>

View File

@ -26,27 +26,29 @@ function TopEdition({register,current_user}) {
const [ bannerList , setBannerList ] = useState(undefined);
useEffect(()=>{
// getBanner();
let list = [
{
id: 1,
image: xingBanner1,
title: "星云协同开发",
url: ""
}
]
setBannerList(list);
getBanner();
},[])
function getBanner() {
const url = `/topics.json?topic_type=banner`;
axios.get(url,{
params:{
limit:5
limit:1
}
}).then(result=>{
if(result){
setBannerList(result.data.topics);
let topic = result.data.topics;
let list = [
{
id:"1",
image:xingBanner1,
local:true,
title:"CCF开源创新平台",
url:""
}
]
const data= topic && topic.length>0?topic:list;
setBannerList(data);
}
}).catch(error=>{})
}
@ -57,9 +59,9 @@ function TopEdition({register,current_user}) {
bannerList.map((i,k)=>{
return(
<div className={`regform`}>
{/* style={{backgroundImage:`url(${getImageUrl(i.image)})`}} */}
<div onClick={()=>{if(i.url){window.location.href=i.url}}} style={{cursor: i.url ? 'pointer' : ''}}>
<img src={i.image} alt="" height="100%"/>
{/* onClick={()=>{if(i.url){window.location.href=i.url}}} */}
<div style={{cursor: 'pointer'}}>
<img src={i.local ? i.image:getImageUrl(i.image)} alt="" height="100%"/>
{/* {
k +1 === bannerList.length && (!(current_user && current_user.login)) ?
<p className="regPrg"><a href={register}>立即注册</a></p>