From edf88cbccfcf571eb8483058e1a17b7e56b4d344 Mon Sep 17 00:00:00 2001 From: Tokumeikoi Date: Sun, 16 Feb 2020 13:52:15 +0800 Subject: [PATCH] fix admin login --- app/Http/Controllers/Passport/AuthController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Passport/AuthController.php b/app/Http/Controllers/Passport/AuthController.php index be2c45f4..726a4526 100644 --- a/app/Http/Controllers/Passport/AuthController.php +++ b/app/Http/Controllers/Passport/AuthController.php @@ -175,13 +175,15 @@ class AuthController extends Controller public function check(Request $request) { - $response = [ + $data = [ 'data' => $request->session()->get('id') ? true : false ]; if ($request->session()->get('is_admin')) { - $response['is_admin'] = true; + $data['is_admin'] = true; } - return response($response); + return response([ + 'data' => $data + ]); } public function forget(AuthForget $request)