是否鉴权
This commit is contained in:
@@ -89,12 +89,18 @@ class BaseService
|
||||
* @var string 时间字段
|
||||
*/
|
||||
protected string $timeField = 'created_at';
|
||||
/**
|
||||
* @var bool 是否鉴权
|
||||
*/
|
||||
private $auth = true;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->userInfo = JWTService::getInstance()->getToken()->getUserInfo();
|
||||
$this->userId = $this->userInfo['id'] ?? 0;
|
||||
$this->roleId = $this->userInfo['role_id'] ?? 0;
|
||||
if ($this->auth === true) {
|
||||
$this->userInfo = JWTService::getInstance()->getToken()->getUserInfo();
|
||||
$this->userId = $this->userInfo['id'] ?? 0;
|
||||
$this->roleId = $this->userInfo['role_id'] ?? 0;
|
||||
}
|
||||
$this->utils = UtilsService::getInstance();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user