提示校验优化

This commit is contained in:
2025-03-24 11:09:59 +08:00
parent b9f5e671bc
commit b7775cafcf
3 changed files with 8 additions and 1 deletions
+4 -1
View File
@@ -81,7 +81,7 @@ class UserController
{
$email = Util::getParam($request, 'email');
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
return Util::fail([], trans('required_not_null'));
return Util::fail([], trans('email_error'));
}
// 生成验证码
@@ -138,6 +138,9 @@ class UserController
if ($code != $verification_code) {
return Util::fail([], trans('code_error'));
}
if(strlen($password) < 6) {
return Util::fail([], trans('password_short'));
}
//加密
$hashedPassword = password_hash($password, PASSWORD_DEFAULT);