feat : admin aspect

This commit is contained in:
2025-09-15 14:45:29 +08:00
parent 8665b27294
commit 8046676669
11 changed files with 430 additions and 16 deletions

View File

@@ -12,6 +12,7 @@ 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;
@@ -46,6 +47,7 @@ abstract class BaseAdminService
public function __construct()
{
$this->adminId = (int) $this->getToken()?->claims()?->get(RegisteredClaims::ID) ?? 0;
if ($this->adminId > 0) Context::set('current_admin_id', $this->adminId);
}
/**