From bce4543ab4d72ca7c66ab9b710ec3b8cd822d649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= Date: Fri, 15 Apr 2022 14:55:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=AD=A3=E5=BC=8F=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=B8=AE=E5=8A=A9=E4=B8=AD=E5=BF=83wiki=E4=BB=93?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/glcc/help/index.jsx | 23 +++++++++++++---------- src/glcc/home/contact/index.jsx | 6 +++--- 2 files changed, 16 insertions(+), 13 deletions(-) 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(
-
+ {fileArrInit && fileArrInit.length === 0 ? :
帮助文档 {fileArrInit && fileArrInit.map(item => { @@ -52,9 +55,9 @@ function Help(props) {
- + bg
-
+
}
) } diff --git a/src/glcc/home/contact/index.jsx b/src/glcc/home/contact/index.jsx index 5f422497..0f0841ec 100644 --- a/src/glcc/home/contact/index.jsx +++ b/src/glcc/home/contact/index.jsx @@ -21,12 +21,12 @@ function Contact() {
-
+
gitlink1

加入GitLink

社区QQ群

-
+
gitlink2

关注GitLink

微信公众号

@@ -34,7 +34,7 @@ function Contact() {
{/* 帮助中心 */}
- + help 帮助中心     查看GitLink编程夏令营活动信息及热点问题