From b4bb0a1910f090160c672eda3c0cc091c38bb3ad Mon Sep 17 00:00:00 2001 From: yanwenwu Date: Mon, 18 May 2020 10:12:33 +0800 Subject: [PATCH] logout --- catch/login/controller/Index.php | 9 ++------- catch/login/route.php | 1 + 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/catch/login/controller/Index.php b/catch/login/controller/Index.php index 1b18a91..37cb745 100644 --- a/catch/login/controller/Index.php +++ b/catch/login/controller/Index.php @@ -49,15 +49,10 @@ class Index extends CatchController * 登出 * * @time 2019年11月28日 - * @param CatchAuth $auth * @return \think\response\Json */ - public function logout(CatchAuth $auth): \think\response\Json + public function logout(): \think\response\Json { - if ($auth->logout()) { - return CatchResponse::success(); - } - - return CatchResponse::fail('登出失败'); + return CatchResponse::success(); } } diff --git a/catch/login/route.php b/catch/login/route.php index 90b3847..3a7237e 100644 --- a/catch/login/route.php +++ b/catch/login/route.php @@ -1,4 +1,5 @@ post('login', '\catchAdmin\login\controller\Index@login'); +$router->post('logout', '\catchAdmin\login\controller\Index@logout');