feat: 添加 JWT 支持与开发环境配置,更新 API 路由与中间件

This commit is contained in:
2026-05-08 14:41:01 +08:00
parent bbf58cb076
commit 9f8080cefe
18 changed files with 383 additions and 14 deletions

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Exceptions;
use RuntimeException;
/**
* 玩家端 Bearer 鉴权失败时抛出,由 EnsurePlayerApi 捕获并转为 JSON。
*
* @property-read int $lotteryCode 业务错误码(对齐 docs/04-领域字典 §10SSO 80008999
* @property-read int $httpStatus HTTP 状态码401 未授权、503 服务未配置等)
*/
final class PlayerAuthenticationException extends RuntimeException
{
public function __construct(
string $message,
public readonly int $lotteryCode,
public readonly int $httpStatus = 401,
) {
parent::__construct($message);
}
}