Ken 3 天之前
父節點
當前提交
f6445f5d7c
共有 1 個文件被更改,包括 8 次插入4 次删除
  1. 8 4
      app/Http/Controllers/api/ActivityReward.php

+ 8 - 4
app/Http/Controllers/api/ActivityReward.php

@@ -33,9 +33,13 @@ class ActivityReward extends BaseController
                 'action' => request()->route()->getActionName(),
             ];
             $key = 'api_request_' . md5(json_encode($keys));
-            if (Cache::has($key)) throw new Exception("请求太频繁,请稍后再试。", HttpStatus::CUSTOM_ERROR);
-            Cache::put($key, true, 60);
-            $code = SmsService::sendPhoneCode($params['phone']);
+            if (!Cache::has($key)) {
+                Cache::put($key, true, 60);
+                $code = SmsService::sendPhoneCode($params['phone']);
+            }
+
+
+
 
 
         } catch (ValidationException $e) {
@@ -44,7 +48,7 @@ class ActivityReward extends BaseController
         } catch (Exception $e) {
             return $this->error($e->getMessage(), [], $e->getCode());
         }
-        return $this->success($keys);
+        return $this->success();
     }
 
     public function participate(): JsonResponse