From 98289b05aa66ccd9417be3af954ce6a27f0488e2 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Mon, 22 Mar 2021 14:19:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AA=E7=99=BB=E5=BD=95=E4=B8=8D=E5=BC=B9?= =?UTF-8?q?=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/tpm/TPMIndex.css | 2 +- src/modules/tpm/TPMIndexHOC.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/modules/tpm/TPMIndex.css b/src/modules/tpm/TPMIndex.css index 00afd562..c5fc5204 100644 --- a/src/modules/tpm/TPMIndex.css +++ b/src/modules/tpm/TPMIndex.css @@ -437,7 +437,7 @@ body>.-task-title { border: none; padding: 0px; } -.newFooter .module-list>a { +.newFooter .module-list a { display: block; color: #bbb; line-height: 34px; diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js index ee18c651..9418b47b 100644 --- a/src/modules/tpm/TPMIndexHOC.js +++ b/src/modules/tpm/TPMIndexHOC.js @@ -169,12 +169,14 @@ export function TPMIndexHOC(WrappedComponent) { if (this.props.match.path === "/" && response.data.login) { this.props.history.push(`/users/${response.data.login}`); } - if(!response.data.has_gitea_user || (response.data.has_gitea_user && !response.data.is_sync_pwd)){ - this.setState({ - giteaVisible:true, - email:response.data.email, - is_sync_pwd:response.data.is_sync_pwd - }) + if(response.data && response.data.login){ + if(!response.data.has_gitea_user || (response.data.has_gitea_user && !response.data.is_sync_pwd)){ + this.setState({ + giteaVisible:true, + email:response.data.email, + is_sync_pwd:response.data.is_sync_pwd + }) + } } } }).catch((error) => {