修正退出登录
This commit is contained in:
@@ -254,11 +254,14 @@ class UserService extends BaseService
|
||||
}
|
||||
|
||||
$token = explode(' ', $bearer_token[0]);
|
||||
if (!isset($token[1])){
|
||||
return fail();
|
||||
}
|
||||
|
||||
$redis = $this->container->get(Redis::class);
|
||||
|
||||
// 旧token加入黑名单 5天有效期,5天内,无法继续进行访问
|
||||
$res = $redis->set('jwt_black_' . $token, time(), 60*60*24*5);
|
||||
$res = $redis->set('jwt_black_' . $token[1], time(), 60*60*24*5);
|
||||
if (!$res) {
|
||||
return fail(HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user