美文网首页
hansh检测数据是否正确

hansh检测数据是否正确

作者: GQ1994 | 来源:发表于2016-10-31 16:20 被阅读0次
Route::any('hansh',function (){
    $password=Request::get('password');
    $hash=Hash::make($password);
    session(['hpassword'=>$hash]);
    return session('hpassword');
});
Route::any('hansh2',function (){
    $pwd=session('hpassword');
    $password=Request::get('password');
    if(Hash::check($password,$pwd)){
        return "密码正确";
    }
    else{
        return "密码错误";
    }
});

相关文章

网友评论

      本文标题:hansh检测数据是否正确

      本文链接:https://www.haomeiwen.com/subject/mqsputtx.html