xiaogang 4 năm trước cách đây
mục cha
commit
91e71b8f25

+ 3 - 0
app/Http/Controllers/Api/DynamicController.php

@@ -13,6 +13,7 @@ use Illuminate\Http\Request;
 use Illuminate\Support\Facades\Cache;
 use Illuminate\Support\Facades\Cache;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Validator;
 use Illuminate\Support\Facades\Validator;
+use PHPUnit\Util\Exception;
 
 
 class DynamicController extends Controller
 class DynamicController extends Controller
 {
 {
@@ -145,6 +146,8 @@ class DynamicController extends Controller
                 $zan = $this->dynamicService->zan($dynamic_zan_param);
                 $zan = $this->dynamicService->zan($dynamic_zan_param);
                 DB::commit();
                 DB::commit();
                 $lock->release();
                 $lock->release();
+            }else{
+                throw new Exception("请求太频繁");
             }
             }
         }catch (\Exception $exception){
         }catch (\Exception $exception){
             DB::rollBack();
             DB::rollBack();