mirror of
https://gitee.com/ctexthuang/hyperf-micro-svc.git
synced 2026-02-08 10:20:16 +08:00
14 lines
258 B
PHP
14 lines
258 B
PHP
<?php
|
|
|
|
namespace App\Lib\Jwt;
|
|
|
|
use Hyperf\Context\RequestContext;
|
|
use Lcobucci\JWT\UnencryptedToken;
|
|
|
|
trait RequestScopedTokenTrait
|
|
{
|
|
public function getToken(): ?UnencryptedToken
|
|
{
|
|
return RequestContext::get()->getAttribute('token');
|
|
}
|
|
} |