multi-store/app/api/controller/BaseApiController.php
2024-05-30 21:37:55 +08:00

18 lines
457 B
PHP

<?php
namespace app\api\controller;
use app\common\controller\BaseLikeController;
class BaseApiController extends BaseLikeController
{
protected int $userId = 0;
protected array $userInfo = [];
public function initialize()
{
if (isset($this->request->userInfo) && $this->request->userInfo) {
$this->userInfo = $this->request->userInfo;
$this->userId = $this->request->userInfo['user_id'];
}
}
}