From ff361a2a82c9764fbacc5f8500da2e0dfd480374 Mon Sep 17 00:00:00 2001 From: liuhengshu <1375360142@qq.com> Date: Fri, 30 Jan 2026 15:58:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=8F=AF=E4=BF=A1=E7=AD=89=E7=BA=A7?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/projectHome/explore/index.jsx | 17 +++++++++-------- src/forge/projectHome/explore/index.scss | 7 ++++++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/forge/projectHome/explore/index.jsx b/src/forge/projectHome/explore/index.jsx index 8b2ea7a82..c97d4a284 100644 --- a/src/forge/projectHome/explore/index.jsx +++ b/src/forge/projectHome/explore/index.jsx @@ -21,7 +21,8 @@ const { Search } = Input; function ProjectHomePage(props) { const {mygetHelmetapi} = props; const {common} = mygetHelmetapi || {}; - const {governance="http://172.16.6.252:10010"} = common || {}; + // const {governance="http://172.16.6.252:10010"} = common || {}; + const governance=(window.location.hostname=='172.16.6.250'||window.location.hostname=='localhost')?'http://172.16.6.252:10002':'http://27.122.114.160:4000/governanceAdmin' const carouselEL = createRef() const [current, setCurrent] = useState(0); const [cateList, setCateList] = useState(undefined); @@ -64,6 +65,7 @@ function ProjectHomePage(props) { const LIMIT = !topicsLength ? 30 : 25; const trustLevelMap = { + '-1':'待治理', 0: '不可信', 1: '高度可信', 2: '可信', @@ -73,7 +75,7 @@ function ProjectHomePage(props) { getCate(); // getList(); getCateTopic(); - document.title = '菌用开源软件仓库'; + document.title = '军用开源软件仓库'; // 获取总数 getInitCount(); }, []) @@ -123,7 +125,6 @@ function ProjectHomePage(props) { params.language_id = topicId.split(",") params.topic_id = undefined } - axios.get(url, { params }).then(result => { if (result && result.data) { setTotal(result.data.total_count); @@ -137,16 +138,16 @@ function ProjectHomePage(props) { current: 1 } ); - const { data: records=[] } = response; + const records=response.data.data.records||[] const trustLevel = records.length > 0 ? records[0].isTrust : null; return { ...project, - trustLevel: trustLevel // 假设返回的数据中有一个 trustLevel 字段 + trustLevel: trustLevel|| '-1' // 假设返回的数据中有一个 trustLevel 字段 }; } catch (error) { return { ...project, - trustLevel: null // 如果请求失败,设置 trustLevel 为 null 或其他适当的值 + trustLevel: '-1' // 如果请求失败,设置 trustLevel 为 null 或其他适当的值 }; } }); @@ -180,8 +181,8 @@ function ProjectHomePage(props) {