发布推送
This commit is contained in:
35
app/Thrid/Sms/SmsBase.php
Normal file
35
app/Thrid/Sms/SmsBase.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?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,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user