更新API限制策略

This commit is contained in:
EasyChen 2022-01-23 11:13:55 +08:00
parent 52b5044141
commit d6a4517018

View File

@ -57,7 +57,7 @@ class RouteServiceProvider extends ServiceProvider
protected function configureRateLimiting() protected function configureRateLimiting()
{ {
RateLimiter::for('api', function (Request $request) { 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());
}); });
} }
} }