Merge branch 'gitlink_ssr_head_nscc' of https://gitlink.org.cn/Gitlink/forgeplus-react into gitlink_ssr_head

This commit is contained in:
谢思 2026-06-03 16:16:37 +08:00
commit fbb19687ff
1 changed files with 18 additions and 13 deletions

View File

@ -8,7 +8,7 @@ import SpecialProjectsByNSCC from './component/specialProjectsByNSCC';
import '../../indexZone1.scss'
import './index.scss'
import { getUniqueIdentifier, getUserName, getBrowserPlatform, getBrowserBrand } from '../../utils'
import { getNewsDetail, getSubDocList, getZoneStatistics, setZoneVisits } from '../../api'
import { getDocAndContentList, getNewsDetail, getSubDocList, getZoneStatistics, setZoneVisits } from '../../api'
import { Anchor, Carousel } from 'antd';
import { Base64 } from 'js-base64';
import CountUp from 'react-countup';
@ -54,17 +54,22 @@ function HeaderPageUos(props) {
setZoneVisits({ url, username, uuid, remark })
//
getSubDocList(window.location.host.includes("gitlink.org.cn") ? 1039 : 2810, { pageSize: 100, pageNum: 1, auditStatus: 1 }).then(async (result) => {
if (!result) return;
const rows = result.data.rows || [];
await Promise.all(
rows.map(async (item) => {
const detail = await getNewsDetail(item.id);
if (detail) item.docContent = detail.data.data.content;
})
);
setMainList(rows);
}).catch(console.error);
getDocAndContentList(window.location.host.includes("gitlink.org.cn") ? 1039 : 2810).then(res=>{
if(res && res.data && res.data.code === 200){
setMainList(res.data.rows)
}
})
// getSubDocList(window.location.host.includes("gitlink.org.cn") ? 1039 : 2810, { pageSize: 100, pageNum: 1, auditStatus: 1 }).then(async (result) => {
// if (!result) return;
// const rows = result.data.rows || [];
// await Promise.all(
// rows.map(async (item) => {
// const detail = await getNewsDetail(item.id);
// if (detail) item.docContent = detail.data.data.content;
// })
// );
// setMainList(rows);
// }).catch(console.error);
InitContentObs();
//
@ -145,7 +150,7 @@ function HeaderPageUos(props) {
<div style={{minHeight: '200px'}}>
<Carousel autoplay={false} ref={carouselEL} dots={false} afterChange={setCurrent}>
{mainList.map(item => {
return <div><div className='width1600' dangerouslySetInnerHTML={{__html: Base64.decode(item.docContent)}}></div></div>
return <div><div className='width1600' dangerouslySetInnerHTML={{__html: Base64.decode(item.content)}}></div></div>
})}
</Carousel>
</div>