diff --git a/src/forge/Information/Pages/newsDetail.jsx b/src/forge/Information/Pages/newsDetail.jsx index 6f6960829..5b96b8ea7 100644 --- a/src/forge/Information/Pages/newsDetail.jsx +++ b/src/forge/Information/Pages/newsDetail.jsx @@ -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' &&
  • } { detail.auditStatus === '0' &&
  • } + { detail.keywords &&
    文章标签:{ detail.keywords.split(',').map(e => ( + { e } + )) }
    } { !IsPC() && } { - content ? - + content ? : 暂无详情~ } diff --git a/src/forge/Information/index.scss b/src/forge/Information/index.scss index 6681aab39..36e8c5ec5 100644 --- a/src/forge/Information/index.scss +++ b/src/forge/Information/index.scss @@ -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; diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 77ced1348..6564e0147 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -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({ diff --git a/src/glcc/index.jsx b/src/glcc/index.jsx index c4e091d3a..5e3033f6b 100644 --- a/src/glcc/index.jsx +++ b/src/glcc/index.jsx @@ -171,7 +171,7 @@ const Glcc = (propsF) => { const [studentRegId, setStudentRegId] = useState(undefined); useEffect(()=>{ - document.title='开源夏令营'; + document.title='确实开源编程夏令营丨GLCC'; }, []) // 是否为导师身份