From efe3410c6e1ed035a8ed84633493391066ab293d Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 12 Jun 2020 11:31:08 +0800 Subject: [PATCH] bug --- src/modules/tpm/TPMIndexHOC.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js index 54412381..a00cebf2 100644 --- a/src/modules/tpm/TPMIndexHOC.js +++ b/src/modules/tpm/TPMIndexHOC.js @@ -165,10 +165,12 @@ export function TPMIndexHOC(WrappedComponent) { this.setState({ tpmLoading: false }) - const { pathname } = this.props.history.location; - console.log("pathname ",pathname); - if(pathname ==="/"){ - this.props.history.push(`/users/${response.data.login}`); + if(response.data.login){ + const { pathname } = this.props.history.location; + console.log("pathname ",pathname); + if(pathname ==="/"){ + this.props.history.push(`/users/${response.data.login}`); + } } } }).catch((error) => {