diff --git a/app/Http/Controllers/Passport/LoginController.php b/app/Http/Controllers/Passport/LoginController.php index 5484ae0c..eb912e08 100755 --- a/app/Http/Controllers/Passport/LoginController.php +++ b/app/Http/Controllers/Passport/LoginController.php @@ -54,4 +54,10 @@ class LoginController extends Controller } header('Location:' . $location); } + + public function check (Request $request) { + return response([ + 'data' => $request->session()->get('id') ? true : false + ]); + } } diff --git a/routes/api.php b/routes/api.php index 106b63a0..8a1b4a83 100755 --- a/routes/api.php +++ b/routes/api.php @@ -106,6 +106,7 @@ Route::prefix('v1') // Login Route::post('login', 'Passport\\LoginController@index'); Route::get ('token2Login', 'Passport\\LoginController@token2Login'); + Route::get ('check', 'Passport\\LoginController@check'); // Forget Route::post('forget', 'Passport\\ForgetController@index'); });