Merge pull request '新增专区文章关键词' (#756) from Eeeros/forgeplus-react:gitlink_ssr_test into gitlink_ssr

1
This commit is contained in:
Eeeros 2024-06-28 15:51:11 +08:00
commit 889fac5bd6
4 changed files with 46 additions and 21 deletions

View File

@ -71,9 +71,9 @@ function NewsDetail(props){
document.title= zonedetail.name;
setSeoMeta(`${zonedetail.name}`, zonedetail.name, zonedetail.subTitle, `/zone/${deptId}`)
} else {
const { name, cmsDir, summary, id} = detail;
let { name, cmsDir, summary, id, keywords} = detail;
const title = `${ name }/${ cmsDir.name }`;
const keywords = `${ name },${ cmsDir.name },${ zonedetail.name }`;
keywords = keywords || `${ name },${ cmsDir.name },${ zonedetail.name }`;
document.title = title;
setSeoMeta(keywords, title, summary, `/zone/${deptId}/newdetail/${ id }`)
}
@ -130,11 +130,13 @@ function NewsDetail(props){
{ detail.auditStatus === '2' && <li><Badge color={temp === "zone" ? "#466aff" : "#089f7f"} text="待审核" className='pass'/></li>}
{ detail.auditStatus === '0' && <li><Badge color="#eb1212" text="未通过" className='failed'/></li>}
</ul>
{ detail.keywords && <div className='keywords'>文章标签{ detail.keywords.split(',').map(e => (
<span>{ e }</span>
)) }</div>}
</div>
{ !IsPC() && <Divider dashed={true} /> }
{
content ?
<RenderHtml className="informations_detail imageLayerParent" value={content} url={props.history.location} />
content ? <RenderHtml className="informations_detail imageLayerParent" value={content} url={props.history.location} />
:
<span>暂无详情~</span>
}

View File

@ -487,6 +487,21 @@
background-image:linear-gradient(180deg,#f8f9fd 0%,#f8f9fd 100%);
border:1px solid #ffffff;
box-sizing: border-box;
.keywords {
color: #232b3f;
font-size: 14px;
line-height: 28px;
margin-top: 10px;
span {
display: inline-block;
background-color: #eff2ff;
border-radius: 4px;
padding: 0 10px;
color: #466aff;
margin-right: 5px;
margin-bottom: 10px !important;
}
}
}
.info_text_main{
margin-bottom: 2em;
@ -553,6 +568,20 @@
background-color: #fff;
border-radius: 4px;
padding:30px 35px 50px;
.keywords {
color: #232b3f;
font-size: 14px;
line-height: 28px;
margin-top: 10px;
span {
display: inline-block;
background-color: #eff2ff;
border-radius: 4px;
padding: 0 10px;
color: #466aff;
margin-right: 5px;
}
}
.info_text_main{
.i_name{
color:#1f2329;

View File

@ -270,17 +270,10 @@ class Detail extends Component {
console.log("--------start channel --------");
// 是镜像项目,且未完成迁移
this.canvasChannel();
if (num) {
this.setState({
secondSync: true,
firstSync: false
})
} else {
this.setState({
firstSync: true,
secondSync: false
})
}
this.setState({
firstSync: true,
secondSync: false
})
this.setState({
mirror_status:1
})
@ -334,7 +327,7 @@ class Detail extends Component {
disconnected: () => {
console.log("###### cannot connected! ######");
},
received: data => {
received: async data => {
console.log(`###### ---received data--- ######`);
if (data) {
if (deleteFlag) {
@ -344,7 +337,8 @@ class Detail extends Component {
if (data.project && data.project.mirror_status === 2) {
this.deleteProjectBack();
}
this.getDetail();
const projectdata = await getProjectDetailFunc(owner, projectsId, !window.location.host).data;
this.getDetail(projectdata)
this.getBanner();
}
this.setState({
@ -941,12 +935,12 @@ Detail.preFetch = ({ store, match, query }) => {
return new Promise(async function(resolve, reject) {
let { dispatch, getState } = store;
// const { owner,projectsId } = match.params
const detail = await dispatch(setProjectDetail(match.params))
const promises = [
dispatch(setProjectDetail(match.params)),
dispatch(setProject(match.params)),
dispatch(setProjectEntries({...match.params, branch: ''})),
dispatch(setProjectEntries({...match.params, branch: match.params.branchName ? match.params.branchName : detail.default_branch})),
dispatch(setProjectMenuList(match.params)),
dispatch(setProjectReadMe({...match.params, branch: ''}))
dispatch(setProjectReadMe({...match.params, branch: match.params.branchName ? match.params.branchName : detail.default_branch}))
];
const data = await Promise.all(promises);
resolve({

View File

@ -171,7 +171,7 @@ const Glcc = (propsF) => {
const [studentRegId, setStudentRegId] = useState(undefined);
useEffect(()=>{
document.title='开源夏令营';
document.title='确实开源编程夏令营丨GLCC';
}, [])
//