Skip to content

Commit

Permalink
图片上传接口兼容
Browse files Browse the repository at this point in the history
  • Loading branch information
justmd5 committed Dec 9, 2022
1 parent baaff94 commit 6dbc52b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ public function auth(bool $auth = true): Api
}

/**
* @param string $method
* @param array $params
* @param string $data_type
* @param string $type API接口名称
* @param array $params 请求参数 非公参以外参数
* @param string $data_type 响应格式,即返回数据的格式,JSON或者XML(二选一),默认JSON,注意是大写
*
* @return mixed
*/
public function request(string $method, array $params = [], string $data_type = 'JSON')
public function request(string $type, array $params = [], string $data_type = 'JSON', $version = 'V1')
{
$http = $this->getHttp();
$params = $this->paramsHandle($params);
Expand All @@ -72,8 +72,9 @@ public function request(string $method, array $params = [], string $data_type =
}
$params['client_id'] = $this->pinduoduo['oauth.access_token']->getClientId();
$params['sign_method'] = 'md5';
$params['type'] = $method;
$params['type'] = $type;
$params['data_type'] = $data_type;
$params['version'] = $version;
$params['timestamp'] = strval(time());
$params['sign'] = $this->signature($params);
$method = 'post';
Expand Down

0 comments on commit 6dbc52b

Please sign in to comment.