feat: 控制器中将authService作为内部属性以便子类控制器访问

This commit is contained in:
augushong
2025-05-07 17:45:56 +08:00
parent 633738d2a1
commit 45d2a2307a

View File

@@ -108,6 +108,13 @@ class AdminControllerBase extends BaseController
*/
protected $sessionAdmin;
/**
* 权限服务
*
* @var AuthService
*/
protected $authService;
/**
* 初始化方法.
*/
@@ -481,6 +488,7 @@ class AdminControllerBase extends BaseController
/** @var AuthService $authService */
$authService = app(AuthService::class, ['adminId' => $adminId]);
$this->authService = $authService;
$currentNode = $authService->getCurrentNode();
if (is_null($currentNode)) {