php – Facebook登录#_ = _后面的URL

前端之家收集整理的这篇文章主要介绍了php – Facebook登录#_ = _后面的URL前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
Facebook登入
// Get the page we were before
  $redirect = Session::get('loginRedirect','hirer/account');

域名成了这个

http://domain.com/hirer/account#_=_

#=背后是什么,我怎么不显示它?

虽然这个帖子很老,但希望这可能对其他人有所帮助.
我看到有些人通过向重定向页面添加javascript代码解决问题,从该位置删除#_ = _.

然而,这对我来说很难看.还有另一种方法可以从后端解决这个问题.你可以让你的重定向网址包含你自己的主播#,这样它就会覆盖facebook添加的#_ = _.例如,这是我的Laravel的handleProviderCallback:

public function handleProviderCallback()
{
    $user = Socialize::with('facebook')->user();
    // add the user to your database if it doesn't exist

    // redirect the user to home page,the anchor # is 
    // to overwrite #_=_ anchor added by facebook
    return redirect('/#');
}
原文链接:https://www.f2er.com/php/137692.html

猜你在找的PHP相关文章