This commit is contained in:
mkm 2023-09-12 12:45:18 +08:00
parent b905b58053
commit f2bce7816f
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ trait SignTrait
$apiSecret = $secret['apiSecret'];
$host = $secret['host'];
$request_line = $secret['requestLine'];
$date = empty($secret['date']) ? gmdate ('D, d M Y H:i:s \G\M\T', time()) : $secret['date'];
$date = empty($secret['date']) ? date ('D, d M Y H:i:s \G\M\T', time()) : $secret['date'];
$signature_origin = "host: $host\ndate: $date\n$request_line";
$signature_sha = hash_hmac('sha256', $signature_origin, $apiSecret, true);
$signature = base64_encode($signature_sha);

View File

@ -58,7 +58,7 @@ class TcClient
$uri = self::signUriV1(TcConstants::URI, [
'apiKey' => $this->apiKey,
'apiSecret' => $this->apiSecret,
'host' => TcConstants::HOST,
'host' => 'ceshi-worker-task.lihaink.cn',
'requestLine' => TcConstants::REQUEST_LINE
]);
$body = self::generateInput($text, $this->appId, $this->uid, $this->resId, $this->requestConfig->toArray());