登录
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user