0
在Laravel代码src \照射\基金会\身份验证\ AuthenticatesUsers.php,有一种方法如下 -
protected function authenticated(Request $request, $user)
{
//
}
这种方法似乎是重定向登录的用户的欢迎登录的用户页面,但方法是空白的。当我在这个方法中插入'return'hello user';'那么该页面显示'你好用户'。我想改变这种方法重定向到一个自定义的网址,并想知道我能在哪里做出更改,并研究与此方法相关的其他代码。我很难找到我正在寻找的正确代码。
编辑:上述方法用于此方法中的三元代码中的相同文件中。我试图找出他们如何一起工作 -
protected function sendLoginResponse(Request $request)
{
$request->session()->regenerate();
$this->clearLoginAttempts($request);
return $this->authenticated($request, $this->guard()->user())
?: redirect()->intended($this->redirectPath());
}
你不应该在你的'src \ illuminate \ Foundation \ Auth \ AuthenticatesUsers.php'中弄乱它,它是核心laravel文件 –
嘿Nikhil,你能帮我一下吗? - https://stackoverflow.com/questions/44174928/laravel-5-4-how-do-i-redirect-logged-in-users-to-referral-url-after-successful –
可能重复的[Laravel 5.4,如何在成功登录后将登录用户重定向到引用URL?](https://stackoverflow.com/questions/44174928/laravel-5-4-how-do-i-redirect-logged-in-users-to-转诊网址后成功) – linktoahref