From adf036d8c75dd65d700bde9f459cc827e8714dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=BE=D0=B2=D0=B0=D1=80=D0=B8=D1=89=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D0=B8=D1=81=D1=82?= <46831212+ComradeProgrammer@users.noreply.github.com> Date: Mon, 14 Feb 2022 19:47:18 +0800 Subject: [PATCH] fix: fix missing username in forgetpage (#487) --- web/src/auth/ForgetPage.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/src/auth/ForgetPage.js b/web/src/auth/ForgetPage.js index bb687959..b4e569fc 100644 --- a/web/src/auth/ForgetPage.js +++ b/web/src/auth/ForgetPage.js @@ -124,6 +124,7 @@ class ForgetPage extends React.Component { } if (this.state.isFixed) { forms.step2.setFieldsValue({email: this.state.fixedContent}) + this.setState({username: this.state.fixedContent}) } this.setState({current: 1}) } else { @@ -133,10 +134,15 @@ class ForgetPage extends React.Component { break; case "step2": const oAuthParams = Util.getOAuthGetParameters(); + if(this.state.verifyType=="email"){ + this.setState({username: this.state.email}) + }else if(this.state.verifyType=="phone"){ + this.setState({username: this.state.phone}) + } AuthBackend.login({ application: forms.step2.getFieldValue("application"), organization: forms.step2.getFieldValue("organization"), - username: forms.step2.getFieldValue("email"), + username: this.state.username, code: forms.step2.getFieldValue("emailCode"), phonePrefix: this.state.application?.organizationObj.phonePrefix, type: "login"