From 5d6553787ddf6287834a0f0b89db378deba51e68 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Sat, 14 Sep 2024 15:54:53 +0800 Subject: [PATCH] =?UTF-8?q?menu=5Flist=E6=9A=82=E6=97=B6=E4=B8=80=E7=9B=B4?= =?UTF-8?q?=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/Detail.js | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 8bee6d0bd..34eb55009 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -449,19 +449,28 @@ class Detail extends Component { // 获取动态导航栏菜单 async getBanner(data) { const { projectsId, owner } = this.props.match.params; - if (!data) { - const url = `/${owner}/${projectsId}/menu_list.json`; - const res = await axios.get(url) - if (res.data) { - data = res.data + const url = `/${owner}/${projectsId}/menu_list.json`; + axios.get(url).then(res=>{ + if(res && res.data){ + this.setState({ + bannerList: res.data + }) } - } - - if (data) { - this.setState({ - bannerList: data - }) - } + }) + // if (!data) { + // const url = `/${owner}/${projectsId}/menu_list.json`; + // axios.get(url).then(res=>{ + // if(res && res.data){ + // this.setState({ + // bannerList: res.data + // }) + // } + // }) + // }else{ + // this.setState({ + // bannerList: data + // }) + // } } // 关注和取消关注