| @@ 25-37 (lines=13) @@ | ||
| 22 | $this->sendContentSms($to, $content); |
|
| 23 | } |
|
| 24 | ||
| 25 | public function sendContentSms($to, $content) |
|
| 26 | { |
|
| 27 | $url = 'http://sms-api.luosimao.com/v1/send.json'; |
|
| 28 | $optData = [ |
|
| 29 | 'mobile' => $to, |
|
| 30 | 'message' => $content, |
|
| 31 | ]; |
|
| 32 | $result = $this->curl($url, $optData, true, [ |
|
| 33 | CURLOPT_HTTPAUTH => CURLAUTH_BASIC, |
|
| 34 | CURLOPT_USERPWD => "api:key-$this->apikey", |
|
| 35 | ]); |
|
| 36 | $this->setResult($result); |
|
| 37 | } |
|
| 38 | ||
| 39 | public function voiceVerify($to, $code, $tempId, array $data) |
|
| 40 | { |
|
| @@ 39-51 (lines=13) @@ | ||
| 36 | $this->setResult($result); |
|
| 37 | } |
|
| 38 | ||
| 39 | public function voiceVerify($to, $code, $tempId, array $data) |
|
| 40 | { |
|
| 41 | $url = 'http://voice-api.luosimao.com/v1/verify.json'; |
|
| 42 | $optData = [ |
|
| 43 | 'mobile' => $to, |
|
| 44 | 'code' => $code, |
|
| 45 | ]; |
|
| 46 | $result = $this->curl($url, $optData, true, [ |
|
| 47 | CURLOPT_HTTPAUTH => CURLAUTH_BASIC, |
|
| 48 | CURLOPT_USERPWD => "api:key-$this->voiceApikey", |
|
| 49 | ]); |
|
| 50 | $this->setResult($result); |
|
| 51 | } |
|
| 52 | ||
| 53 | protected function setResult($result) |
|
| 54 | { |
|