V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
V2EX  ›  anviod  ›  全部回复第 11 页 / 共 11 页
回复总数  202
1 ... 2  3  4  5  6  7  8  9  10  11  
2017 年 1 月 10 日
回复了 xx19941215 创建的主题 PHP laravel 5.3 自定义登陆成功后的跳转路由无效?
@xx19941215
<?php

namespace Illuminate\Foundation\Auth;

trait RedirectsUsers
{
/**
* Get the post register / login redirect path.
*
* @return string
*/
public function redirectPath()
{
if (method_exists($this, 'redirectTo')) {
return $this->redirectTo();
}

return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home';
}
}

若自定义 redirectTo 成员函数 需要返回值为 string 类型。
可以这样写
protected function redirectTo()
{
// die('ok');
return '/index';
}
2017 年 1 月 8 日
回复了 xx19941215 创建的主题 PHP laravel 5.3 自定义登陆成功后的跳转路由无效?
默认不给参数 就是自动跳转到 /home
去看 Illuminate\Foundation\Auth\RedirectsUsers;
第十八行

return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home';
1 ... 2  3  4  5  6  7  8  9  10  11  
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3212 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 14ms · UTC 12:51 · PVG 20:51 · LAX 05:51 · JFK 08:51
♥ Do have faith in what you're doing.