From c6ce76cd764547760be5326d722fafc2fdc75f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9C=E8=99=9E=E6=B8=A0=E6=88=90=E2=80=9D?= <“yuqucheng2006@qq.com”> Date: Tue, 28 Jul 2026 15:48:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(validation&password):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E4=B8=BA=E7=A9=BA=E6=97=B6=E7=9A=84=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改了邮箱校验的前置处理逻辑,同时在两个设置密码的面板中添加密码为空时的快速校验拦截,重置规则显示并禁用确认按钮 --- .../Scripts/UI/Pages/Login/SubPages/SetPasswordPanel.cs | 8 ++++++++ Assets/Scripts/UI/Pages/SelfPage/SelfSetPasswordPanel.cs | 8 ++++++++ Assets/Scripts/Utils/ValidationUtils.cs | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/UI/Pages/Login/SubPages/SetPasswordPanel.cs b/Assets/Scripts/UI/Pages/Login/SubPages/SetPasswordPanel.cs index 6f2e8bb..9c128b6 100644 --- a/Assets/Scripts/UI/Pages/Login/SubPages/SetPasswordPanel.cs +++ b/Assets/Scripts/UI/Pages/Login/SubPages/SetPasswordPanel.cs @@ -162,6 +162,14 @@ namespace Kill.UI.Pages string newPwd = newPasswordInput != null ? newPasswordInput.text : ""; string confirmPwd = confirmPasswordInput != null ? confirmPasswordInput.text : ""; + // 密码为空时,所有规则显示错误 + if (string.IsNullOrEmpty(newPwd)) + { + ResetRulesDisplay(); + isConfirmEnabled = false; + return; + } + bool pwdRulesValid = false; if (passwordType == 0) diff --git a/Assets/Scripts/UI/Pages/SelfPage/SelfSetPasswordPanel.cs b/Assets/Scripts/UI/Pages/SelfPage/SelfSetPasswordPanel.cs index 7734f30..d05d4d1 100644 --- a/Assets/Scripts/UI/Pages/SelfPage/SelfSetPasswordPanel.cs +++ b/Assets/Scripts/UI/Pages/SelfPage/SelfSetPasswordPanel.cs @@ -146,6 +146,14 @@ namespace Kill.UI.Pages string newPwd = newPasswordInput != null ? newPasswordInput.text : ""; string confirmPwd = confirmPasswordInput != null ? confirmPasswordInput.text : ""; + // 密码为空时,所有规则显示错误 + if (string.IsNullOrEmpty(newPwd)) + { + ResetRulesDisplay(); + isConfirmEnabled = false; + return; + } + bool pwdRulesValid = false; if (passwordType == 0) diff --git a/Assets/Scripts/Utils/ValidationUtils.cs b/Assets/Scripts/Utils/ValidationUtils.cs index 6a50839..5a7723d 100644 --- a/Assets/Scripts/Utils/ValidationUtils.cs +++ b/Assets/Scripts/Utils/ValidationUtils.cs @@ -107,7 +107,7 @@ namespace Kill.Utils { if (string.IsNullOrEmpty(email)) return true; - string emailName = email.Contains('@') ? email.Split('@')[0] : email; + string emailName = email; string pwdLower = password.ToLower(); for (int i = 0; i <= emailName.Length - 2; i++)