增加基础配置
Some checks failed
Build Docker / build (push) Has been cancelled

This commit is contained in:
2025-07-12 11:59:33 +08:00
parent fb50096e66
commit 8a3ab17b25
44 changed files with 1599 additions and 66 deletions

View File

@ -18,7 +18,6 @@ namespace App\Middleware;
use App\Context\UserContext;
use App\Exception\ApiException;
use App\JsonRpc\UserAuthServiceInterface;
use App\Repository\Company\FirstCompanyRepository;
use Exception;
use Hyperf\Di\Annotation\Inject;
use Psr\Container\ContainerInterface;
@ -56,11 +55,12 @@ class CheckTokenMiddleware implements MiddlewareInterface
$rpcResult = $this->userAuthServiceInterface->userInfoByToken(['token' => $token]);
$userInfo = $rpcResult['result']['user'] ?? [];
$userInfo = $rpcResult['result'] ?? [];
if (!$userInfo) {
throw new ApiException('用户信息不存在', 401);
}
UserContext::setCurrentToken($token);
UserContext::setCurrentUser($userInfo);
return $handler->handle($request);