|
...
|
...
|
@@ -12,6 +12,7 @@ use Lackoxygen\TopWarehouse\Contracts\RequestInterface; |
|
|
|
use GuzzleHttp\Client as guzzleClient;
|
|
|
|
use Lackoxygen\TopWarehouse\Contracts\ResponseInterface;
|
|
|
|
use Lackoxygen\TopWarehouse\Exception\Exception;
|
|
|
|
use Lackoxygen\TopWarehouse\Utils\Json;
|
|
|
|
use Lackoxygen\TopWarehouse\Utils\SignatureUtil;
|
|
|
|
|
|
|
|
class Client implements ClientInterface
|
|
...
|
...
|
@@ -78,11 +79,18 @@ class Client implements ClientInterface |
|
|
|
$key = RequestOptions::FORM_PARAMS;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$data = $this->request->toArray() + [
|
|
|
|
$pathInfo = parse_url($this->request->getPath());
|
|
|
|
|
|
|
|
$pathQuery = Arr::get($pathInfo, 'query');
|
|
|
|
|
|
|
|
parse_str($pathQuery, $pathQueryArray);
|
|
|
|
|
|
|
|
$data = $this->request->toArray() + [
|
|
|
|
'app_key' => Arr::get($this->config, 'app_key'),
|
|
|
|
'v' => $this->request->getVersion(),
|
|
|
|
'timestamp' => date('Y-m-d H:i:s'),
|
|
|
|
];
|
|
|
|
] + $pathQueryArray;
|
|
|
|
|
|
|
|
$data['sign'] = SignatureUtil::generate($data, Arr::get($this->config, 'app_secret'));
|
|
|
|
$response = $this->guzzleClient->request($this->request->getMethod(), $this->request->getPath(), [
|
|
|
|
$key => $data
|
...
|
...
|
|