Skip to content

Commit 3025a88

Browse files
committed
增加用户模型的缓存驱动
1 parent e497c7a commit 3025a88

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"require": {
1212
"php": ">=7.4.0",
1313
"laravel/framework": "^8.56",
14-
"laravel/sanctum": "^2.11"
14+
"laravel/sanctum": "^2.11",
15+
"yangjisen/laravel-cache-provider": "^3.0"
1516
},
1617
"autoload": {
1718
"psr-4": {

src/Console/ApiCommand.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ protected function publishConfig()
2424
$this->call('vendor:publish', [
2525
'--provider' => 'Jason\Api\ApiServiceProvider',
2626
]);
27+
$this->call('vendor:publish', [
28+
'--provider' => 'YangJiSen\CacheUserProvider\ServiceProvider',
29+
]);
2730
$this->call('migrate');
2831
}
2932

src/Console/stubs/Controller.stub

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ class Controller extends BaseController
99
{
1010

1111
use ApiResponse;
12+
1213
}

src/Listeners/LoginListener.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
class LoginListener
66
{
77

8+
/**
9+
* Notes : 登录成功后,自动删除原有的token
10+
* 这样大概能做到单点登录的效果
11+
* @Date : 2021/8/27 9:40 上午
12+
* @Author : <Jason.C>
13+
* @param $event
14+
*/
815
public function handle($event)
916
{
1017
if (config('api.token_auto_revoke')) {

0 commit comments

Comments
 (0)