feat : common redis cache and common logger

This commit is contained in:
2025-09-14 15:58:45 +08:00
parent 48ad2ebd1b
commit 0db9995c19
15 changed files with 640 additions and 14 deletions

View File

@@ -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;
}
/**