部分前台接口

This commit is contained in:
2025-05-07 16:52:49 +08:00
parent 7a08ac219e
commit 8a99bcb904
8 changed files with 65 additions and 5 deletions

View File

@@ -96,6 +96,13 @@ class BaseService
if ($this->isAuth) {
$this->userInfo = JWTService::getInstance()->getToken()->getUserInfo();
$this->userId = $this->userInfo['id'] ?? 0;
} else {
try {
$this->userInfo = JWTService::getInstance()->getToken()->getUserInfo();
$this->userId = $this->userInfo['id'] ?? 0;
} catch (Exception $e) {
$this->userId = 0;
}
}
$this->utils = UtilsService::getInstance();
}