From 53de6e86f1ff91f8a535bb299898e579dbee0d86 Mon Sep 17 00:00:00 2001 From: dongrui <38676269+whDongRui@users.noreply.github.com> Date: Mon, 8 Oct 2018 15:20:50 +0800 Subject: [PATCH] fix: Modify header show condition (#464) --- src/components/Header/index.jsx | 7 ++++--- src/routes/renderRoute.js | 13 ++++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/components/Header/index.jsx b/src/components/Header/index.jsx index 710227d2..9023a057 100644 --- a/src/components/Header/index.jsx +++ b/src/components/Header/index.jsx @@ -25,8 +25,9 @@ class Header extends Component { }; onSearch = async value => { - const { appStore } = this.props; - this.props.history.push('/store/search/' + value); + const { appStore, history, isHome } = this.props; + const pushUrl = isHome ? `/apps/search/${value}` : `/store/search/${value}`; + this.props.history.push(pushUrl); await appStore.fetchAll({ search_word: value }); appStore.homeApps = appStore.apps; }; @@ -149,7 +150,7 @@ class Header extends Component {