|
|
@ -28,9 +28,27 @@ class TaskClient
|
|
|
|
return json_decode($result, true);
|
|
|
|
return json_decode($result, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function sendSms($mobile, $clientIp, $type = 'common')
|
|
|
|
public function sendSmsCode(string $mobile, string $clientIp)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return $this->post('/message/sms-send', ['mobile' => $mobile, 'type' => $type, 'client_ip' => $clientIp]);
|
|
|
|
$options = ['type' => 'code', 'client_ip' => $clientIp];
|
|
|
|
|
|
|
|
return $this->sendSms($mobile, $options);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function sendSmsContent(string $mobile, string $content)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$options = ['type' => 'content', 'content' => $content];
|
|
|
|
|
|
|
|
return $this->sendSms($mobile, $options);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function sendSmsBatch(array $mobiles, string $content)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$options = ['type' => 'batch', 'content' => $content];
|
|
|
|
|
|
|
|
return $this->sendSms($mobiles, $options);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private function sendSms($mobile, array $options)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return $this->post('/message/sms-send', ['mobile' => $mobile, 'options' => $options]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function checkSms($mobile, $code)
|
|
|
|
public function checkSms($mobile, $code)
|
|
|
|