From d6a45170186dfeb6074f0a72fe2161606d75930a Mon Sep 17 00:00:00 2001 From: EasyChen Date: Sun, 23 Jan 2022 11:13:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0API=E9=99=90=E5=88=B6?= =?UTF-8?q?=E7=AD=96=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/Providers/RouteServiceProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/app/Providers/RouteServiceProvider.php b/api/app/Providers/RouteServiceProvider.php index 9130cee..8edb5d9 100644 --- a/api/app/Providers/RouteServiceProvider.php +++ b/api/app/Providers/RouteServiceProvider.php @@ -57,7 +57,7 @@ class RouteServiceProvider extends ServiceProvider protected function configureRateLimiting() { RateLimiter::for('api', function (Request $request) { - return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); + return Limit::perMinute(60)->by(uid() ?: $request->ip()); }); } }