forked from Gitlink/forgeplus-react
更新正式环境帮助中心wiki仓库
This commit is contained in:
parent
41c0a29bef
commit
bce4543ab4
|
@ -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>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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'>帮助中心 </span>
|
||||
<span className='font-18 small_32'>查看GitLink编程夏令营活动信息及热点问题</span>
|
||||
<Button type="danger" className='joinHelp font-16 mr40' onClick={()=>{window.open("/glcc/help")}}>进入帮助中心</Button>
|
||||
|
|
Loading…
Reference in New Issue