From 2d79d144a0768e3f7199cb2ae7e656d210dcdd52 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 11 Jun 2021 17:21:11 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=AE=E7=AE=B1=E5=BC=B9=E6=A1=86=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/tpm/TPMIndexHOC.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js index ce5c4514..51cbb0de 100644 --- a/src/modules/tpm/TPMIndexHOC.js +++ b/src/modules/tpm/TPMIndexHOC.js @@ -181,10 +181,11 @@ export function TPMIndexHOC(WrappedComponent) { } } if(response.data && response.data.login){ - if(response.data.need_edit_info){ + if(!response.data.has_gitea_user || (response.data.has_gitea_user && !response.data.is_sync_pwd)){ this.setState({ giteaVisible:true, - email:response.data.email + email:response.data.email, + is_sync_pwd:response.data.is_sync_pwd }) } } @@ -212,8 +213,11 @@ export function TPMIndexHOC(WrappedComponent) { } onOk =(values)=>{ - let url = `/users/sync_user_info.json`; - const { current_user } = this.state; + let url = `/accounts/gitea_register.json`; + const { email , current_user , is_sync_pwd } = this.state; + if(email && !is_sync_pwd){ + url = `/users/change_password.json`; + } axios.post(url,{ login:current_user && current_user.login, ...values