feat: 增强管理员 API 鉴权,新增 token 有效天数配置,更新相关异常处理与错误码引用

This commit is contained in:
2026-05-09 11:26:39 +08:00
parent 8a70c029f6
commit f1b38ef421
13 changed files with 124 additions and 42 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Http\Middleware;
use App\Exceptions\PlayerAuthenticationException;
use App\Lottery\ErrorCode;
use App\Services\PlayerTokenResolver;
use App\Support\ApiResponse;
use App\Support\LotteryMessage;
@@ -15,7 +16,7 @@ use Symfony\Component\HttpFoundation\Response;
*
* - 成功:解析 Bearer Player写入 request attribute `lottery_player`
* - 失败:直接 JSON 返回,不进入控制器;其中 msg 经由 LotteryMessage::sso() 按请求语言翻译
* (依赖前置的 NegotiateLotteryLocalecode 仍为文档约定业务码(如 8001
* (依赖前置的 NegotiateLotteryLocalecode {@see ErrorCode} 中玩家鉴权段
*
* PlayerAuthenticationException getMessage() 仅作开发与日志用语,可与 API msg 语种不一致。
*/