update: middleware

This commit is contained in:
tokumeikoi 2021-06-25 22:35:14 +09:00
parent 760d248e4e
commit 9c711b4ea6

View File

@ -20,10 +20,9 @@ class User
$user = \App\Models\User::where('password', $authData[1]) $user = \App\Models\User::where('password', $authData[1])
->where('email', $authData[0]) ->where('email', $authData[0])
->first(); ->first();
if ($user) { if (!$user) abort(500, '鉴权失败,请重新登入');
$request->session()->put('email', $user->email); $request->session()->put('email', $user->email);
$request->session()->put('id', $user->id); $request->session()->put('id', $user->id);
}
} }
// if ($request->input('lang')) { // if ($request->input('lang')) {
// $request->session()->put('lang', $request->input('lang')); // $request->session()->put('lang', $request->input('lang'));