Skip to content

Commit

Permalink
laravel-sms 添加ip限制功能 添加env配置前缀
Browse files Browse the repository at this point in the history
  • Loading branch information
tangqi198707 committed Jan 8, 2020
1 parent cf68f2e commit 7bd9af6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@

'storage' => \iBrand\Sms\Storage\CacheStorage::class,

'enable_rate_limit' => env('ENABLE_RATE_LIMIT', false),
'enable_rate_limit' => env('SMS_ENABLE_RATE_LIMIT', false),//是否开启

'rate_limit_middleware' => 'iBrand\Sms\Http\Middleware\ThrottleRequests',

'rate_limit_count' => env('RATE_LIMIT_COUNT', 10),
'rate_limit_count' => env('SMS_RATE_LIMIT_COUNT', 10), //次数

'rate_limit_time' => env('RATE_LIMIT_TIME', 60), //分钟
'rate_limit_time' => env('SMS_RATE_LIMIT_TIME', 60), //分钟
];
6 changes: 3 additions & 3 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
<env name="ENABLE_RATE_LIMIT" value="true"/>
<env name="RATE_LIMIT_COUNT" value="3"/>
<env name="RATE_LIMIT_TIME" value="3600"/>
<env name="SMS_ENABLE_RATE_LIMIT" value="true"/>
<env name="SMS_RATE_LIMIT_COUNT" value="3"/>
<env name="SMS_RATE_LIMIT_TIME" value="3600"/>
</php>
</phpunit>

0 comments on commit 7bd9af6

Please sign in to comment.