diff --git a/web/src/auth/LoginPage.js b/web/src/auth/LoginPage.js index 5532b27f..7a5637aa 100644 --- a/web/src/auth/LoginPage.js +++ b/web/src/auth/LoginPage.js @@ -648,6 +648,9 @@ class LoginPage extends React.Component { ) ; } else if (signinItem.name === "Username") { + if (this.state.loginMethod === "wechat") { + return (); + } return (
" + signinItem.customCss?.replaceAll("", "") + "")}} /> @@ -750,6 +753,9 @@ class LoginPage extends React.Component { } else if (signinItem.name === "Agreement") { return AgreementModal.isAgreementRequired(application) ? AgreementModal.renderAgreementFormItem(application, true, {}, this) : null; } else if (signinItem.name === "Login button") { + if (this.state.loginMethod === "wechat") { + return null; + } return (
" + signinItem.customCss?.replaceAll("", "") + "")}} /> @@ -896,10 +902,6 @@ class LoginPage extends React.Component { loginWidth += 10; } - if (this.state.loginMethod === "wechat") { - return (); - } - return (
method.name === "WeChat" && method.rule === "Login page"); + return ( @@ -1420,6 +1425,15 @@ class LoginPage extends React.Component { }
+ { + wechatSigninMethods?.length > 0 ? (
+
+

{i18next.t("provider:Please use WeChat to scan the QR code and follow the official account for sign in")}

+ +
+
+ ) : null + }
diff --git a/web/src/auth/WeChatLoginPanel.js b/web/src/auth/WeChatLoginPanel.js index af08e0e3..8bc8697d 100644 --- a/web/src/auth/WeChatLoginPanel.js +++ b/web/src/auth/WeChatLoginPanel.js @@ -78,13 +78,10 @@ class WeChatLoginPanel extends React.Component { } render() { - const {application, loginWidth = 320} = this.props; + const {loginWidth = 320} = this.props; const {status, qrCode} = this.state; return (
- {application.signinItems?.filter(item => item.name === "Logo").map(signinItem => this.props.renderFormItem(application, signinItem))} - {this.props.renderMethodChoiceBox()} - {application.signinItems?.filter(item => item.name === "Languages").map(signinItem => this.props.renderFormItem(application, signinItem))}
diff --git a/web/src/table/SigninMethodTable.js b/web/src/table/SigninMethodTable.js index d03274da..e91e3a45 100644 --- a/web/src/table/SigninMethodTable.js +++ b/web/src/table/SigninMethodTable.js @@ -96,6 +96,8 @@ class SigninMethodTable extends React.Component { this.updateField(table, index, "displayName", value); if (value === "Verification code" || value === "Password") { this.updateField(table, index, "rule", "All"); + } else if (value === "WeChat") { + this.updateField(table, index, "rule", "Tab"); } else { this.updateField(table, index, "rule", "None"); } @@ -139,6 +141,11 @@ class SigninMethodTable extends React.Component { {id: "Non-LDAP", name: i18next.t("general:Non-LDAP")}, {id: "Hide password", name: i18next.t("general:Hide password")}, ]; + } else if (record.name === "WeChat") { + options = [ + {id: "Tab", name: i18next.t("general:Tab")}, + {id: "Login page", name: i18next.t("general:Login page")}, + ]; } if (options.length === 0) {