mirror of
http://124.126.16.154:8888/singularity/hyperf-admin.git
synced 2026-01-15 05:35:08 +08:00
修复用户退出获取的缓存key不一致 导致redis缓存未删除
This commit is contained in:
@@ -62,7 +62,9 @@ class AuthService
|
|||||||
|
|
||||||
public function logout()
|
public function logout()
|
||||||
{
|
{
|
||||||
$user = $this->user();
|
$token = cookie(config('admin_cookie_name', '')) ?: (request_header('x-token')[0] ?? '');
|
||||||
|
$payload = JWT::verifyToken($token);
|
||||||
|
$user = Arr::get($payload, 'user_info');
|
||||||
$cache_key = config('user_info_cache_prefix') . md5(json_encode($user));
|
$cache_key = config('user_info_cache_prefix') . md5(json_encode($user));
|
||||||
Redis::del($cache_key);
|
Redis::del($cache_key);
|
||||||
Context::set('user_info', null);
|
Context::set('user_info', null);
|
||||||
|
|||||||
Reference in New Issue
Block a user