From 3025a88c9ef0276426d7b56051eff697adadc48f Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 27 Aug 2021 09:41:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E7=9A=84=E7=BC=93=E5=AD=98=E9=A9=B1=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 3 ++- src/Console/ApiCommand.php | 3 +++ src/Console/stubs/Controller.stub | 1 + src/Listeners/LoginListener.php | 7 +++++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 524ca51..e0ed18e 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,8 @@ "require": { "php": ">=7.4.0", "laravel/framework": "^8.56", - "laravel/sanctum": "^2.11" + "laravel/sanctum": "^2.11", + "yangjisen/laravel-cache-provider": "^3.0" }, "autoload": { "psr-4": { diff --git a/src/Console/ApiCommand.php b/src/Console/ApiCommand.php index 1ddd553..558a216 100644 --- a/src/Console/ApiCommand.php +++ b/src/Console/ApiCommand.php @@ -24,6 +24,9 @@ protected function publishConfig() $this->call('vendor:publish', [ '--provider' => 'Jason\Api\ApiServiceProvider', ]); + $this->call('vendor:publish', [ + '--provider' => 'YangJiSen\CacheUserProvider\ServiceProvider', + ]); $this->call('migrate'); } diff --git a/src/Console/stubs/Controller.stub b/src/Console/stubs/Controller.stub index 5c3bd64..18e022e 100644 --- a/src/Console/stubs/Controller.stub +++ b/src/Console/stubs/Controller.stub @@ -9,4 +9,5 @@ class Controller extends BaseController { use ApiResponse; + } diff --git a/src/Listeners/LoginListener.php b/src/Listeners/LoginListener.php index 4190f1c..eb0015d 100644 --- a/src/Listeners/LoginListener.php +++ b/src/Listeners/LoginListener.php @@ -5,6 +5,13 @@ class LoginListener { + /** + * Notes : 登录成功后,自动删除原有的token + * 这样大概能做到单点登录的效果 + * @Date : 2021/8/27 9:40 上午 + * @Author : + * @param $event + */ public function handle($event) { if (config('api.token_auto_revoke')) {