36 lines
789 B
PHP
36 lines
789 B
PHP
<?php
|
|
|
|
namespace App\Thrid\Sms;
|
|
|
|
use GuzzleHttp\Exception\GuzzleException;
|
|
|
|
abstract class SmsBase implements SmsInterface
|
|
{
|
|
|
|
function sendSmsCode($phone, $code, $iSendType = self::SMS_SEND_TYPE_CHARACTER): bool
|
|
{
|
|
|
|
}
|
|
|
|
/**
|
|
* @throws GuzzleException
|
|
*/
|
|
function sendReq($path, $aData, $aHeaders = null): \Psr\Http\Message\ResponseInterface
|
|
{
|
|
$url = $this->getUrl() . $path;
|
|
$client = new \GuzzleHttp\Client();
|
|
if ($aHeaders) {
|
|
$aHeaders = [
|
|
'accept' => 'application/json',
|
|
'content-type' => 'application/x-www-form-urlencoded',
|
|
];
|
|
}
|
|
return $client->request('POST', $url, [
|
|
'headers' => $aHeaders,
|
|
'body' => $aData,
|
|
]);
|
|
}
|
|
|
|
|
|
}
|