更新正式环境帮助中心wiki仓库

This commit is contained in:
谢思 2022-04-15 14:55:53 +08:00
parent 41c0a29bef
commit bce4543ab4
2 changed files with 16 additions and 13 deletions

View File

@ -1,4 +1,5 @@
import React , { useEffect , useState } from 'react';
import NodataPanel from '../../components/nodata-panel';
import { wikiPages, getWiki } from '../../forge/Wiki/api';
import bg from '../img/help_bg.png';
import './index.scss';
@ -7,13 +8,15 @@ function Help(props) {
const [fileArrInit, setFileArrInit] = useState(null);
const [checkItem, setCheckItem] = useState({});
const [itemDetail, setItemDetail] = useState({});
// locationStatus true false
const locationStatus = window.location.host.indexOf("50008") !== -1 || window.location.host.indexOf("gitlink") !== -1;
// wiki
useEffect(()=>{
wikiPages({
owner: 'forgetest2',
repo: 'wiki1',
projectId: '546103'
owner: locationStatus ? 'GLCC' : 'forgetest2',
repo: locationStatus ? 'glcc2022' : 'wiki1',
projectId: locationStatus ? '1403785' : '546103'
}).then(res => {
if (res && res.message === "200" && Array.isArray(res.data)) {
setFileArrInit(res.data);
@ -29,10 +32,10 @@ function Help(props) {
// wiki
useEffect(() => {
checkItem.name && getWiki({
owner: 'forgetest2',
repo: 'wiki1',
owner: locationStatus ? 'GLCC' : 'forgetest2',
repo: locationStatus ? 'glcc2022' : 'wiki1',
pagename: checkItem.name,
projectId: '546103'
projectId: locationStatus ? '1403785' : '546103'
}).then(res => {
if (res && res.message === "200") {
setItemDetail(res.data);
@ -41,10 +44,10 @@ function Help(props) {
}
});
}, [checkItem]);
return(
<div className="glcc_help">
<div className='help_main'>
{fileArrInit && fileArrInit.length === 0 ? <NodataPanel/> : <div className='help_main'>
<div className='menuList'>
<span className='font-18 mb15'>帮助文档</span>
{fileArrInit && fileArrInit.map(item => {
@ -52,9 +55,9 @@ function Help(props) {
</div>
<div className="help_cntent pt10" >
<div dangerouslySetInnerHTML={{ __html: itemDetail && itemDetail.simple_content }}></div>
<img src={bg} className='bg'/>
<img src={bg} className='bg' alt='bg'/>
</div>
</div>
</div>}
</div>
)
}

View File

@ -21,12 +21,12 @@ function Contact() {
</div>
<div className='attention'>
<div className='one'>
<div className='attentionDiv'><img src={gitlink1}/></div>
<div className='attentionDiv'><img src={gitlink1} alt="gitlink1"/></div>
<p>加入GitLink</p>
<p>社区QQ群</p>
</div>
<div>
<div className='attentionDiv'><img src={gitlink2}/></div>
<div className='attentionDiv'><img src={gitlink2} alt="gitlink2"/></div>
<p>关注GitLink</p>
<p>微信公众号</p>
</div>
@ -34,7 +34,7 @@ function Contact() {
</div>
{/* 帮助中心 */}
<div className='glcc_help'>
<img src={help} />
<img src={help} alt='help'/>
<span className='font-32 title_32'>帮助中心&nbsp;&nbsp;&nbsp;&nbsp;</span>
<span className='font-18 small_32'>查看GitLink编程夏令营活动信息及热点问题</span>
<Button type="danger" className='joinHelp font-16 mr40' onClick={()=>{window.open("/glcc/help")}}>进入帮助中心</Button>