修改AccessToken处理

This commit is contained in:
Anyon 2020-05-21 10:40:44 +08:00
parent 5cf008c374
commit 59dc89244e

View File

@ -205,17 +205,15 @@ class BasicWeChat
* @param string $url 接口地址 * @param string $url 接口地址
* @param string $method 当前接口方法 * @param string $method 当前接口方法
* @param array $arguments 请求参数 * @param array $arguments 请求参数
* @return mixed * @return string
* @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException * @throws \WeChat\Exceptions\LocalCacheException
*/ */
protected function registerApi(&$url, $method, $arguments = []) protected function registerApi(&$url, $method, $arguments = [])
{ {
$this->currentMethod = ['method' => $method, 'arguments' => $arguments]; $this->currentMethod = ['method' => $method, 'arguments' => $arguments];
if (empty($this->access_token)) { if (empty($this->access_token)) $this->access_token = $this->getAccessToken();
$this->access_token = $this->getAccessToken(); return $url = str_replace('ACCESS_TOKEN', urlencode($this->access_token), $url);
}
return $url = str_replace('ACCESS_TOKEN', $this->access_token, $url);
} }
/** /**