menu_list暂时一直调用

This commit is contained in:
caishi 2024-09-14 15:54:53 +08:00
parent aa71fe1a21
commit 5d6553787d
1 changed files with 21 additions and 12 deletions

View File

@ -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
// })
// }
}
// 关注和取消关注