diff --git a/src/glcc/help/index.jsx b/src/glcc/help/index.jsx index 3f269833..f135501e 100644 --- a/src/glcc/help/index.jsx +++ b/src/glcc/help/index.jsx @@ -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(
加入GitLink
社区QQ群
关注GitLink
微信公众号