mirror of
https://gitee.com/ctexthuang/hyperf_rbac_framework_server_ctexthuang.git
synced 2025-12-25 15:57:50 +08:00
feat : common redis cache and common logger
This commit is contained in:
@@ -10,13 +10,16 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Service\Admin;
|
||||
|
||||
use App\Lib\Jwt\RequestScopedTokenTrait;
|
||||
use App\Lib\Return\AdminReturn;
|
||||
use Hyperf\Context\Context;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Hyperf\HttpServer\Contract\RequestInterface;
|
||||
use Lcobucci\JWT\Token\RegisteredClaims;
|
||||
|
||||
abstract class BaseAdminService
|
||||
{
|
||||
use RequestScopedTokenTrait;
|
||||
|
||||
/**
|
||||
* 请求对象注入
|
||||
* @var RequestInterface
|
||||
@@ -42,7 +45,7 @@ abstract class BaseAdminService
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->adminId = Context::get('admin_id',0);
|
||||
$this->adminId = (int) $this->getToken()?->claims()?->get(RegisteredClaims::ID) ?? 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user