时间:2020-05-01
上方法代码
/**
* 获取腾讯云api调用结果
* @param string $url 请求地址
* @param string $service 操作的服务名称
* @param string $version 操作的 API 的版本
* @param string $action 操作的接口名称
* @param string $httpRequestMethod 请求方式
* @param array|string $payload body体内容
* @return array
*/
function getTencentData($url, $service, $version, $action, $httpRequestMethod, $payload = [])
{
$secretId = config('tencent.secret_id');
$secretKey = config('tencent.secret_key');
$region = config('tencent.region');
$timestamp = time();
$algorithm = "TC3-HMAC-SHA256";
$httpRequestMethod = strtoupper($httpRequestMethod);
$canonicalUri = '/';
$canonicalQueryString = '';
$url