超算首页-关于我们文章请求接口更换
This commit is contained in:
parent
8779738967
commit
8a49465f3c
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue