正在显示
1 个修改的文件
包含
9 行增加
和
1 行删除
| @@ -12,6 +12,7 @@ use Lackoxygen\TopWarehouse\Contracts\RequestInterface; | @@ -12,6 +12,7 @@ use Lackoxygen\TopWarehouse\Contracts\RequestInterface; | ||
| 12 | use GuzzleHttp\Client as guzzleClient; | 12 | use GuzzleHttp\Client as guzzleClient; |
| 13 | use Lackoxygen\TopWarehouse\Contracts\ResponseInterface; | 13 | use Lackoxygen\TopWarehouse\Contracts\ResponseInterface; |
| 14 | use Lackoxygen\TopWarehouse\Exception\Exception; | 14 | use Lackoxygen\TopWarehouse\Exception\Exception; |
| 15 | +use Lackoxygen\TopWarehouse\Utils\Json; | ||
| 15 | use Lackoxygen\TopWarehouse\Utils\SignatureUtil; | 16 | use Lackoxygen\TopWarehouse\Utils\SignatureUtil; |
| 16 | 17 | ||
| 17 | class Client implements ClientInterface | 18 | class Client implements ClientInterface |
| @@ -78,11 +79,18 @@ class Client implements ClientInterface | @@ -78,11 +79,18 @@ class Client implements ClientInterface | ||
| 78 | $key = RequestOptions::FORM_PARAMS; | 79 | $key = RequestOptions::FORM_PARAMS; |
| 79 | } | 80 | } |
| 80 | } | 81 | } |
| 82 | + $pathInfo = parse_url($this->request->getPath()); | ||
| 83 | + | ||
| 84 | + $pathQuery = Arr::get($pathInfo, 'query'); | ||
| 85 | + | ||
| 86 | + parse_str($pathQuery, $pathQueryArray); | ||
| 87 | + | ||
| 81 | $data = $this->request->toArray() + [ | 88 | $data = $this->request->toArray() + [ |
| 82 | 'app_key' => Arr::get($this->config, 'app_key'), | 89 | 'app_key' => Arr::get($this->config, 'app_key'), |
| 83 | 'v' => $this->request->getVersion(), | 90 | 'v' => $this->request->getVersion(), |
| 84 | 'timestamp' => date('Y-m-d H:i:s'), | 91 | 'timestamp' => date('Y-m-d H:i:s'), |
| 85 | - ]; | 92 | + ] + $pathQueryArray; |
| 93 | + | ||
| 86 | $data['sign'] = SignatureUtil::generate($data, Arr::get($this->config, 'app_secret')); | 94 | $data['sign'] = SignatureUtil::generate($data, Arr::get($this->config, 'app_secret')); |
| 87 | $response = $this->guzzleClient->request($this->request->getMethod(), $this->request->getPath(), [ | 95 | $response = $this->guzzleClient->request($this->request->getMethod(), $this->request->getPath(), [ |
| 88 | $key => $data | 96 | $key => $data |
-
请 注册 或 登录 后发表评论