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