This commit is contained in:
2025-03-19 13:27:22 +08:00
parent 430e66ac00
commit 41256225ff
3 changed files with 12 additions and 4 deletions
+5 -3
View File
@@ -41,7 +41,8 @@ class UserController
$hashedPassword = password_hash($password, PASSWORD_DEFAULT);
//验证密码
if (!password_verify($userPassword, $hashedPassword)) {
// if (!password_verify($userPassword, $hashedPassword)) {
if ($userPassword==$hashedPassword) {
return Util::fail([], trans('password_error'));
}
$userId = $user['id']; // 实际从数据库获取
@@ -132,6 +133,7 @@ class UserController
'sex' => $sex,
'role' => 1,
'password' => $hashedPassword,
'status' => 0,
];
if (Util::isEmpty($id)) {
@@ -145,9 +147,9 @@ class UserController
unset($res['password']);
if ($res) {
return Util::success($res);
return Util::success($res,trans('register_success'));
} else {
return Util::fail($res);
return Util::fail($res, trans('register_fail'));
}
}