ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
~~~ /*限流*/ $executed = RateLimiter::attempt('obtaining:'.$user_id, 1, function (){}); if (!$executed) { return $this->error('1 مىنۇتتىن كىيىن قايتا سىناڭ'); } /*限流*/ ~~~ 意思是每分钟内只做 1 次操作 ~~~ /*限流*/ $executed = RateLimiter::attempt('obtaining:'.$user_id, 5, function (){}); if (!$executed) { return $this->error('1 مىنۇتتىن كىيىن قايتا سىناڭ'); } /*限流*/ ~~~ 意思是每分钟内只做 5 次操作 ~~~ /*限流*/ $limiter_name = 'email:'.$email; $executed = RateLimiter::attempt($limiter_name, 1, function (){}); if (!$executed) { $seconds = RateLimiter::availableIn($limiter_name); return $this->error(sprintf('%d سىكۇنتتىن كىيىن قايتا يوللاڭ', $seconds)); } /*限流*/ ~~~