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 "密码错误";
}
});