|
|
|
@ -32,11 +32,11 @@ class Sms extends Api |
|
|
|
|
$this->error(__('手机号不正确')); |
|
|
|
|
} |
|
|
|
|
$last = Smslib::get($mobile, $event); |
|
|
|
|
if ($last && time() - $last['createtime'] < 60) { |
|
|
|
|
if ($last && time() - $last['createtime'] < 5) { |
|
|
|
|
$this->error(__('发送频繁')); |
|
|
|
|
} |
|
|
|
|
$ipSendTotal = \app\common\model\Sms::where(['ip' => $this->request->ip()])->whereTime('createtime', '-1 hours')->count(); |
|
|
|
|
if ($ipSendTotal >= 5) { |
|
|
|
|
if ($ipSendTotal >= 20) { |
|
|
|
|
$this->error(__('发送频繁')); |
|
|
|
|
} |
|
|
|
|
if ($event) { |
|
|
|
@ -57,7 +57,7 @@ class Sms extends Api |
|
|
|
|
} |
|
|
|
|
$ret = Smslib::send($mobile, null, $event); |
|
|
|
|
if ($ret) { |
|
|
|
|
$this->success(__('发送成功')); |
|
|
|
|
$this->success(__('发送成功'),['code' => $ret]); |
|
|
|
|
} else { |
|
|
|
|
$this->error(__('发送失败,请检查短信配置是否正确')); |
|
|
|
|
} |
|
|
|
|