簡體   English   中英

登錄后如何管理laravel 5登錄頁面?

[英]how can manage laravel 5 login page after the logging?

我已經使用make:auth命令創建了laravel 5登錄和注冊表單。 但我的布局文件夾中同時包含home.blade.php和front.blade.php。 我的問題是,當我以“我的索引”頁面(網站的打開頁面)訪問“我的網絡”應用程序時,我需要front.blade.php文件。 然后在使用系統登錄時需要home.blade.php文件。 (做cms工程)。 我的目標位置是routes.php

這是routes.php

Route::auth();






Route::get('/', function () {
    return view('front');
});


Route::get('/home', function () {
    return view('home');
});


Route::get('/about',function(){
    return view('about');
});

Route::get('/bod',function(){
    return view('bod');
});

Route::get('/st',function(){
    return view('st');
});

Route::get('/services',function(){
    return view('services');
});

Route::get('/contact',function(){
    return view('contact');
});

Route::get('/welcome',function(){
    return view('welcome');
});


Route::auth();

Route::get('/home', 'HomeController@index');

但是,當我使用上述路由時,在使用系統登錄后,我的Web應用程序始終重定向到front.blade.php文件。 系統登錄后,我需要使用home.blade.php進行重定向。

您可以在前面的路線內添加支票,如果用戶已登錄,則可以重定向到首頁。

if (Auth::check()) {
    return redirect('home');
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM