以下是一个优化后的示例,使用了 bcrypt 来处理密码哈希: # 使用 BCrypt::Password 的 `==` 方法来验证密码 使用BCrypt::Password 的 == 方法来验证密码,这…