From 465d03b33e2b995eb3058b556a06ec6090f48fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 26 Jul 2019 17:29:32 +0800 Subject: [PATCH] b --- public/react/src/modules/tpm/NewHeader.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index dca26a99..5a414b66 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -261,18 +261,21 @@ class NewHeader extends Component { if(this.props.user&&this.props.user.login=== ""||this.props.user&&this.props.user===null){ window.location.href = "/login"; - }else{ - if(sum===1){ - window.location.href = "/courses/new"; - }else if(sum===2){ - window.location.href = "/shixuns/new"; - }else if(sum===3){ - window.location.href = "/paths/new"; - }else if(sum===4){ - window.location.href = "/projects/new"; - } + return + }else if(this.state.current_user&&this.props.user.login=== ""||this.props.user&&this.props.user===null){ + window.location.href = "/login"; + return } + if(sum===1){ + window.location.href = "/courses/new"; + }else if(sum===2){ + window.location.href = "/shixuns/new"; + }else if(sum===3){ + window.location.href = "/paths/new"; + }else if(sum===4){ + window.location.href = "/projects/new"; + } } render() {