|
@@ -31,6 +31,13 @@ class ChuanglanSmsApi {
|
|
|
$deny_list = ["jjrcw.test", "jjrcw.test:8080","report.com","report.jinjianghc.com"]; //拒绝短信名单
|
|
|
if (in_array($_SERVER["HTTP_HOST"], $deny_list))
|
|
|
return false; //测试不发送信息
|
|
|
+ $redis = \app\common\Redis::instance(\think\facade\Config::get("cache.stores.redis.select"));
|
|
|
+ $unique = sha1($mobile.$msg);
|
|
|
+ $time = $redis->get($unique);
|
|
|
+ $now = time();
|
|
|
+ if(!empty($time) && $now-$time < 10800){
|
|
|
+ return false;//3小时内同一个手机号码同一条信息不重复发送
|
|
|
+ }
|
|
|
$result = $this->curlPost(self::API_SEND_URL, $postArr);
|
|
|
return $result;
|
|
|
}
|