我尝试添加一个功能
public function postLogout() {
//Auth::logout();
return response()->json(['msg' => 'You have signed out']);
}
进入文件
\vendor\laravel\framework\src\Illuminate\Foundation\Auth\AuthenticatesUsers.php
并使用一条路线
Route::get('log_out', ['as' => 'auth.log_out', 'uses' => 'Auth\AuthController@postLogout']);
在这种情况下,如何从URL http:// localhost / myproj / public / log_out进行自动重定向???谢谢
您所说的“自动”是什么意思?您要注销用户并随后重定向,对吗?在这种情况下,您可以同时重定向和刷新消息。
Route::get('log_out', function () {
//Auth::logout();
return redirect('log_in')->with('status', 'You have signed out!');
});
在这里阅读更多
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句