Commit 180d0e8f by mushishixian

重置密码优化

parent 7d67b2c3
...@@ -162,6 +162,11 @@ class AuthApiController extends Controller ...@@ -162,6 +162,11 @@ class AuthApiController extends Controller
return $this->setError('Email code invalid'); return $this->setError('Email code invalid');
} }
$hashedPassword = UserModel::where('email', $email)->value('password');
if (Hash::check($password, $hashedPassword)) {
return $this->setError('The new password cannot be the same as the old password!');
}
$user = UserModel::where('email', $email)->first(); $user = UserModel::where('email', $email)->first();
$user->password = Hash::make($password); $user->password = Hash::make($password);
$user->update_time = time(); $user->update_time = time();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment