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

@@ -2,6 +2,8 @@
namespace App\Providers;
use App\Models\Player;
use Illuminate\Http\Request;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
@@ -19,6 +21,10 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot(): void
{
//
// 仅在通过 EnsurePlayerApi 后可用;未走中间件时为 null
Request::macro('lotteryPlayer', function (): ?Player {
/** @var Request $this */
return $this->attributes->get('lottery_player');
});
}
}