|
@@ -26,8 +26,11 @@ class ActivityReward extends BaseController
|
|
|
'member_id' => ['required', 'integer'],
|
|
'member_id' => ['required', 'integer'],
|
|
|
'phone' => ['required', 'string'],
|
|
'phone' => ['required', 'string'],
|
|
|
]);
|
|
]);
|
|
|
- $params['action'] = request()->action;
|
|
|
|
|
- $key = 'api_request_' . md5(json_encode($params));
|
|
|
|
|
|
|
+ $keys = [
|
|
|
|
|
+ 'ip' => request()->ip(),
|
|
|
|
|
+ 'action' => request()->action,
|
|
|
|
|
+ ];
|
|
|
|
|
+ $key = 'api_request_' . md5(json_encode($keys));
|
|
|
if (Cache::has($key)) throw new Exception("请求太频繁,请稍后再试。", HttpStatus::CUSTOM_ERROR);
|
|
if (Cache::has($key)) throw new Exception("请求太频繁,请稍后再试。", HttpStatus::CUSTOM_ERROR);
|
|
|
Cache::put($key, true, 60);
|
|
Cache::put($key, true, 60);
|
|
|
|
|
|