forked from Gitlink/forgeplus-react
bug
This commit is contained in:
parent
3cc907f6de
commit
5b6a6b6da2
|
@ -323,7 +323,6 @@ class App extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { pathType, pathName, mygetHelmetapi } = this.state;
|
const { pathType, pathName, mygetHelmetapi } = this.state;
|
||||||
console.log("dsf:",pathName);
|
|
||||||
return (
|
return (
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<ConfigProvider locale={zhCN}>
|
<ConfigProvider locale={zhCN}>
|
||||||
|
|
|
@ -26,27 +26,29 @@ function TopEdition({register,current_user}) {
|
||||||
const [ bannerList , setBannerList ] = useState(undefined);
|
const [ bannerList , setBannerList ] = useState(undefined);
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
// getBanner();
|
getBanner();
|
||||||
let list = [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
image: xingBanner1,
|
|
||||||
title: "星云协同开发",
|
|
||||||
url: ""
|
|
||||||
}
|
|
||||||
]
|
|
||||||
setBannerList(list);
|
|
||||||
},[])
|
},[])
|
||||||
|
|
||||||
function getBanner() {
|
function getBanner() {
|
||||||
const url = `/topics.json?topic_type=banner`;
|
const url = `/topics.json?topic_type=banner`;
|
||||||
axios.get(url,{
|
axios.get(url,{
|
||||||
params:{
|
params:{
|
||||||
limit:5
|
limit:1
|
||||||
}
|
}
|
||||||
}).then(result=>{
|
}).then(result=>{
|
||||||
if(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=>{})
|
}).catch(error=>{})
|
||||||
}
|
}
|
||||||
|
@ -57,9 +59,9 @@ function TopEdition({register,current_user}) {
|
||||||
bannerList.map((i,k)=>{
|
bannerList.map((i,k)=>{
|
||||||
return(
|
return(
|
||||||
<div className={`regform`}>
|
<div className={`regform`}>
|
||||||
{/* style={{backgroundImage:`url(${getImageUrl(i.image)})`}} */}
|
{/* onClick={()=>{if(i.url){window.location.href=i.url}}} */}
|
||||||
<div onClick={()=>{if(i.url){window.location.href=i.url}}} style={{cursor: i.url ? 'pointer' : ''}}>
|
<div style={{cursor: 'pointer'}}>
|
||||||
<img src={i.image} alt="" height="100%"/>
|
<img src={i.local ? i.image:getImageUrl(i.image)} alt="" height="100%"/>
|
||||||
{/* {
|
{/* {
|
||||||
k +1 === bannerList.length && (!(current_user && current_user.login)) ?
|
k +1 === bannerList.length && (!(current_user && current_user.login)) ?
|
||||||
<p className="regPrg"><a href={register}>立即注册</a></p>
|
<p className="regPrg"><a href={register}>立即注册</a></p>
|
||||||
|
|
Loading…
Reference in New Issue