是否鉴权

This commit is contained in:
2025-12-01 10:42:28 +08:00
parent 9c28ca2744
commit 120a88da30

View File

@@ -92,11 +92,11 @@ class BaseService
/** /**
* @var bool 是否鉴权 * @var bool 是否鉴权
*/ */
private $auth = true; private $isAuth = true;
public function __construct() public function __construct()
{ {
if ($this->auth === true) { if ($this->isAuth === true) {
$this->userInfo = JWTService::getInstance()->getToken()->getUserInfo(); $this->userInfo = JWTService::getInstance()->getToken()->getUserInfo();
$this->userId = $this->userInfo['id'] ?? 0; $this->userId = $this->userInfo['id'] ?? 0;
$this->roleId = $this->userInfo['role_id'] ?? 0; $this->roleId = $this->userInfo['role_id'] ?? 0;