LayTp交流一群:843093362 LayTp交流一群 发表新帖

api测试接口邮箱登录 自定义密码验证失败

提问 1
dwq
2022-07-22 14:10:43

protected function checkPassword($password, $rule, $data)
{
$email = $data[‘email’];
$user = new User();
$passwordHash = $user->getFieldByEmail($email, ‘password’);
return (!Str::checkPassword(md5($password), $passwordHash)) ? ‘账户信息错误’ : true;
}

// 检验密码
public static function checkPassword($password, $passwordHash)
{
return password_verify(md5($password), $passwordHash);
}

去掉Str::checkPassword(md5($password), $passwordHash) 中的md5() 接口失败

回帖
  • dwq
    2022-07-22 14:57:40

    跨域问题 后台域名设置了二级域名 变更前后台域名后 修改Str::checkPassword(md5($password) 去掉md5() 完美解决