From 552154f6298616666a1309b783b5350d6fb6e93c Mon Sep 17 00:00:00 2001 From: "Tom K.H. Lin" <3011850@gmail.com> Date: Mon, 30 Jul 2018 20:19:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E6=A1=88=E8=80=85=E7=9A=84=E7=99=BB?= =?UTF-8?q?=E5=85=A5=E8=BA=AB=E4=BB=BD=E9=A9=97=E8=AD=89=E5=B0=9A=E6=9C=AA?= =?UTF-8?q?=E5=AE=8C=E6=88=90=EF=BC=8C=E7=9B=AE=E5=89=8D=E5=8F=AA=E6=9C=89?= =?UTF-8?q?=E7=99=BB=E5=85=A5=E7=95=AB=E9=9D=A2=E8=83=BDrun=E8=80=8C?= =?UTF-8?q?=E5=B7=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Exceptions/UserNotFoundException.php | 10 ++++++++ app/Http/Controllers/ReceiverController.php | 28 ++++++++++++++++++++- resources/views/layout/app.blade.php | 16 ++---------- resources/views/layout/login.blade.php | 2 +- resources/views/layout/navbar.blade.php | 22 ++++++++++++++++ routes/web.php | 4 +-- 6 files changed, 64 insertions(+), 18 deletions(-) create mode 100644 app/Exceptions/UserNotFoundException.php create mode 100644 resources/views/layout/navbar.blade.php diff --git a/app/Exceptions/UserNotFoundException.php b/app/Exceptions/UserNotFoundException.php new file mode 100644 index 0000000..a54353b --- /dev/null +++ b/app/Exceptions/UserNotFoundException.php @@ -0,0 +1,10 @@ +all(); + + //輸入資料驗證 + $rules = [ + 'email'=>[ + 'required', + 'email', + ], + 'password'=>[ + 'required', + 'min:6' + ], + ]; + $validate = Validator::make($input,$rules); + if($validate->fails()){ + return redirect('/receiver/loginPage') + ->withErrors($validate)->withInput(); + } + //驗證通過,巷資料庫查詢使用者是否存在 + //Pass->紀錄session + //failed -> 導向至登入畫面(附帶錯誤訊息) + } } diff --git a/resources/views/layout/app.blade.php b/resources/views/layout/app.blade.php index cc93126..d6f42b6 100644 --- a/resources/views/layout/app.blade.php +++ b/resources/views/layout/app.blade.php @@ -10,23 +10,11 @@