fix(validation&password): 新增密码为空时的校验处理逻辑
修改了邮箱校验的前置处理逻辑,同时在两个设置密码的面板中添加密码为空时的快速校验拦截,重置规则显示并禁用确认按钮
This commit is contained in:
parent
4d0448c80d
commit
c6ce76cd76
@ -162,6 +162,14 @@ namespace Kill.UI.Pages
|
|||||||
string newPwd = newPasswordInput != null ? newPasswordInput.text : "";
|
string newPwd = newPasswordInput != null ? newPasswordInput.text : "";
|
||||||
string confirmPwd = confirmPasswordInput != null ? confirmPasswordInput.text : "";
|
string confirmPwd = confirmPasswordInput != null ? confirmPasswordInput.text : "";
|
||||||
|
|
||||||
|
// 密码为空时,所有规则显示错误
|
||||||
|
if (string.IsNullOrEmpty(newPwd))
|
||||||
|
{
|
||||||
|
ResetRulesDisplay();
|
||||||
|
isConfirmEnabled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool pwdRulesValid = false;
|
bool pwdRulesValid = false;
|
||||||
|
|
||||||
if (passwordType == 0)
|
if (passwordType == 0)
|
||||||
|
|||||||
@ -146,6 +146,14 @@ namespace Kill.UI.Pages
|
|||||||
string newPwd = newPasswordInput != null ? newPasswordInput.text : "";
|
string newPwd = newPasswordInput != null ? newPasswordInput.text : "";
|
||||||
string confirmPwd = confirmPasswordInput != null ? confirmPasswordInput.text : "";
|
string confirmPwd = confirmPasswordInput != null ? confirmPasswordInput.text : "";
|
||||||
|
|
||||||
|
// 密码为空时,所有规则显示错误
|
||||||
|
if (string.IsNullOrEmpty(newPwd))
|
||||||
|
{
|
||||||
|
ResetRulesDisplay();
|
||||||
|
isConfirmEnabled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool pwdRulesValid = false;
|
bool pwdRulesValid = false;
|
||||||
|
|
||||||
if (passwordType == 0)
|
if (passwordType == 0)
|
||||||
|
|||||||
@ -107,7 +107,7 @@ namespace Kill.Utils
|
|||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(email)) return true;
|
if (string.IsNullOrEmpty(email)) return true;
|
||||||
|
|
||||||
string emailName = email.Contains('@') ? email.Split('@')[0] : email;
|
string emailName = email;
|
||||||
string pwdLower = password.ToLower();
|
string pwdLower = password.ToLower();
|
||||||
|
|
||||||
for (int i = 0; i <= emailName.Length - 2; i++)
|
for (int i = 0; i <= emailName.Length - 2; i++)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user