From 8a52e35c945c3f7c7544a48e9f4b558ae6c85873 Mon Sep 17 00:00:00 2001 From: XiaoLFeng Date: Sun, 9 Jul 2023 15:35:54 +0800 Subject: [PATCH] =?UTF-8?q?AddFeature:=20=E6=B7=BB=E5=8A=A0=E7=BC=BA?= =?UTF-8?q?=E5=A4=B1=E5=A4=84=E7=90=86=E5=8A=9E=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加 404.blade.php 添加 no-permission.blade.php 路由表配置对应数据及格式整理 Signed-off-by: XiaoLFeng --- resources/views/modules/404.blade.php | 78 +++++++++++++++++ .../views/modules/no-permission.blade.php | 84 +++++++++++++++++++ routes/web.php | 46 +++++----- 3 files changed, 186 insertions(+), 22 deletions(-) create mode 100644 resources/views/modules/404.blade.php create mode 100644 resources/views/modules/no-permission.blade.php diff --git a/resources/views/modules/404.blade.php b/resources/views/modules/404.blade.php new file mode 100644 index 0000000..b5ccad0 --- /dev/null +++ b/resources/views/modules/404.blade.php @@ -0,0 +1,78 @@ + + + + + + + + + @include('modules.head') + {!! $webHeader !!} + + +
+
+ +
+
+

Not Founded

+

没有找到页面 (404 Page Not Founded)

+

+ + + 返回之前页面 + +

+
+
+ +
+
+
+ @if(empty($sqlIcp) && empty($sqlGongan)) +
+
+ @if(empty(!$sqlCopyRightYear)) + {{ $sqlCopyRightYear }}-{{ date('Y') }} + @else + {{ date('Y') }} + @endif {{ $sqlAuthor }}. All Rights Reserved. +
+ @else +
+ @if(empty(!$sqlCopyRightYear)) + {{ $sqlCopyRightYear }}-{{ date('Y') }} + @else + {{ date('Y') }} + @endif {{ $sqlAuthor }}. All Rights Reserved. +
+
+ @if(!empty($sqlIcp)) + {{ $sqlIcp }} + @endif + @if(!empty($sqlGongan)) + {{ $sqlGongan }} + @endif +
+ @endif +
+ + + +{!! $webFooter !!} + diff --git a/resources/views/modules/no-permission.blade.php b/resources/views/modules/no-permission.blade.php new file mode 100644 index 0000000..790d400 --- /dev/null +++ b/resources/views/modules/no-permission.blade.php @@ -0,0 +1,84 @@ + + + + + + + + + @include('modules.head') + {!! $webHeader !!} + + +
+
+ +
+
+

No Permission

+

您没有权限

+

+ + + 返回主界面 + + + + 切换用户 + +

+
+
+ +
+
+
+ @if(empty($sqlIcp) && empty($sqlGongan)) +
+
+ @if(empty(!$sqlCopyRightYear)) + {{ $sqlCopyRightYear }}-{{ date('Y') }} + @else + {{ date('Y') }} + @endif {{ $sqlAuthor }}. All Rights Reserved. +
+ @else +
+ @if(empty(!$sqlCopyRightYear)) + {{ $sqlCopyRightYear }}-{{ date('Y') }} + @else + {{ date('Y') }} + @endif {{ $sqlAuthor }}. All Rights Reserved. +
+
+ @if(!empty($sqlIcp)) + {{ $sqlIcp }} + @endif + @if(!empty($sqlGongan)) + {{ $sqlGongan }} + @endif +
+ @endif +
+ + + +{!! $webFooter !!} + diff --git a/routes/web.php b/routes/web.php index 3d326f6..c6dcd64 100644 --- a/routes/web.php +++ b/routes/web.php @@ -25,20 +25,22 @@ | */ -Route::get('/', [Index::class,'ViewIndex'])->name('home'); +Route::get('/', [Index::class, 'ViewIndex'])->name('home'); Route::get('about', [Index::class, 'ViewAboutMe'])->name('about'); +Route::get('404', [Index::class, 'viewPageNotFounded'])->name('404'); +Route::get('no-permission', [Index::class, 'viewNoPermission'])->name('no-permission'); Route::get('backup', [\App\Http\Controllers\DataBase::class, '__construct']); Route::prefix('function')->group(function () { - Route::get('link',[UserLink::class, 'viewLink'])->name('function.link'); + Route::get('link', [UserLink::class, 'viewLink'])->name('function.link'); Route::get('make-friend', [UserLink::class, 'viewMakeFriend'])->name('function.make-friend'); Route::get('edit-search', [UserLink::class, 'viewSearchFriends'])->name('function.edit-search'); Route::get('edit-search/{friendId}', [UserLink::class, 'viewSearchFriend'])->name('function.edit-searchOnly'); - Route::get('edit-friend/{friendId}',[UserLink::class,'viewEditFriend'])->name('function.edit-friend'); - Route::get('sponsor',function () { + Route::get('edit-friend/{friendId}', [UserLink::class, 'viewEditFriend'])->name('function.edit-friend'); + Route::get('sponsor', function () { return view('function.sponsor'); })->name('function.sponsor'); - Route::get('music',function () { + Route::get('music', function () { return view('function.music'); })->name('function.music'); }); @@ -50,38 +52,38 @@ }); }); -Route::prefix('console')->middleware('auth')->group(function () { - Route::get('dashboard', [Dashboard::class,'ViewDashboard'])->name('console.dashboard'); +Route::prefix('console')->middleware('authConsole')->group(function () { + Route::get('dashboard', [Dashboard::class, 'ViewDashboard'])->name('console.dashboard'); Route::prefix('friends-link')->group(function () { - Route::redirect('list','list/1'); - Route::get('list',[ConsoleLink::class,'ViewList'])->name('console.friends-link.list'); - Route::get('check',[ConsoleLink::class,'ViewCheck'])->name('console.friends-link.check'); - Route::get('edit/{userId}',function ($userId) { + Route::redirect('list', 'list/1'); + Route::get('list', [ConsoleLink::class, 'ViewList'])->name('console.friends-link.list'); + Route::get('check', [ConsoleLink::class, 'ViewCheck'])->name('console.friends-link.check'); + Route::get('edit/{userId}', function ($userId) { $ConsoleLink = new ConsoleLink(); $request = new Request(); - return $ConsoleLink->ViewEdit($request,$userId); + return $ConsoleLink->ViewEdit($request, $userId); })->name('console.friends-link.edit'); - Route::get('add',[ConsoleLink::class,'ViewAdd'])->name('console.friends-link.add'); - Route::get('sort',[ConsoleLink::class,'ViewSort'])->name('console.friends-link.sort'); - Route::get('color',[ConsoleLink::class,'ViewColor'])->name('console.friends-link.color'); + Route::get('add', [ConsoleLink::class, 'ViewAdd'])->name('console.friends-link.add'); + Route::get('sort', [ConsoleLink::class, 'ViewSort'])->name('console.friends-link.sort'); + Route::get('color', [ConsoleLink::class, 'ViewColor'])->name('console.friends-link.color'); }); }); Route::prefix('auth')->group(function () { - Route::redirect('','auth/login'); + Route::redirect('', 'auth/login'); Route::get('login', function () { $data = (new Index())->data; - return view('auth.login',$data); + return view('auth.login', $data); })->name('login'); - Route::get('register',function () { + Route::get('register', function () { $data = (new Index())->data; - return view('auth.register',$data); + return view('auth.register', $data); })->name('register'); - Route::get('forgotpassword',function () { + Route::get('forgotpassword', function () { $data = (new Index())->data; - return view('auth.forgotpassword',$data); + return view('auth.forgotpassword', $data); })->name('forgotpassword'); - Route::match(['get','post'],'logout',function () { + Route::match(['get', 'post'], 'logout', function () { Auth::logout(); return Response::redirectTo(''); })->name('logout');