|
@@ -37,8 +37,8 @@ class Sms extends Api
|
|
*/
|
|
*/
|
|
public function send()
|
|
public function send()
|
|
{
|
|
{
|
|
- $countrycode = input("countrycode",65,'intval');
|
|
|
|
$mobile = input("mobile");
|
|
$mobile = input("mobile");
|
|
|
|
+ $countrycode = input("countrycode",65,'intval');
|
|
$event = input("event",'default');
|
|
$event = input("event",'default');
|
|
$event = $event ? $event : 'register';
|
|
$event = $event ? $event : 'register';
|
|
|
|
|
|
@@ -55,7 +55,7 @@ class Sms extends Api
|
|
$this->error(__('发送频繁'));
|
|
$this->error(__('发送频繁'));
|
|
}
|
|
}
|
|
if ($event) {
|
|
if ($event) {
|
|
- $userinfo = User::getByMobile($fullmobile);
|
|
|
|
|
|
+ /*$userinfo = User::getByMobile($fullmobile);
|
|
if ($event == 'register' && $userinfo) {
|
|
if ($event == 'register' && $userinfo) {
|
|
//已被注册
|
|
//已被注册
|
|
$this->error(__('已被注册'));
|
|
$this->error(__('已被注册'));
|
|
@@ -65,11 +65,11 @@ class Sms extends Api
|
|
} elseif (in_array($event, ['changepwd', 'resetpwd']) && !$userinfo) {
|
|
} elseif (in_array($event, ['changepwd', 'resetpwd']) && !$userinfo) {
|
|
//未注册
|
|
//未注册
|
|
$this->error(__('未注册'));
|
|
$this->error(__('未注册'));
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
}
|
|
}
|
|
- if (!Hook::get('sms_send')) {
|
|
|
|
|
|
+ /*if (!Hook::get('sms_send')) {
|
|
$this->error(__('请在后台插件管理安装短信验证插件'));
|
|
$this->error(__('请在后台插件管理安装短信验证插件'));
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
$ret = Smslib::send($mobile, null, $event,$countrycode);
|
|
$ret = Smslib::send($mobile, null, $event,$countrycode);
|
|
if ($ret) {
|
|
if ($ret) {
|
|
$this->success(__('发送成功'));
|
|
$this->success(__('发送成功'));
|