hansh检测数据是否正确

2016-10-31  本文已影响0人  GQ1994
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 "密码错误";
    }
});
上一篇下一篇

猜你喜欢

热点阅读