mirror of
https://gitee.com/ctexthuang/hyperf_rbac_framework_server_ctexthuang.git
synced 2025-12-25 19:27:48 +08:00
fix : jwt
Some checks failed
Build Docker / build (push) Has been cancelled
Some checks failed
Build Docker / build (push) Has been cancelled
This commit is contained in:
@@ -12,12 +12,20 @@ namespace App\Service\Admin\AdminUser;
|
||||
|
||||
use App\Lib\Jwt\RequestScopedTokenTrait;
|
||||
use App\Service\Admin\BaseAdminService;
|
||||
use App\Service\BaseTokenService;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Lcobucci\JWT\Token\RegisteredClaims;
|
||||
|
||||
class UserService extends BaseAdminService
|
||||
{
|
||||
use RequestScopedTokenTrait;
|
||||
|
||||
/**
|
||||
* @var BaseTokenService
|
||||
*/
|
||||
#[Inject]
|
||||
protected BaseTokenService $tokenService;
|
||||
|
||||
public function handle(): array
|
||||
{
|
||||
var_dump($this->getToken()->claims()->all());
|
||||
@@ -27,8 +35,13 @@ class UserService extends BaseAdminService
|
||||
return $this->adminReturn->success();
|
||||
}
|
||||
|
||||
public function refresh(): array
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function logout(): array
|
||||
{
|
||||
$this->tokenService->setJwt('admin')->getJwt()->addBlackList($this->getToken());
|
||||
|
||||
return $this->adminReturn->success();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user