From 59dc89244e27fa12eb39b0d4d866da526ee38994 Mon Sep 17 00:00:00 2001 From: Anyon Date: Thu, 21 May 2020 10:40:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9AccessToken=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WeChat/Contracts/BasicWeChat.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/WeChat/Contracts/BasicWeChat.php b/WeChat/Contracts/BasicWeChat.php index 81c3645..af4337b 100644 --- a/WeChat/Contracts/BasicWeChat.php +++ b/WeChat/Contracts/BasicWeChat.php @@ -205,17 +205,15 @@ class BasicWeChat * @param string $url 接口地址 * @param string $method 当前接口方法 * @param array $arguments 请求参数 - * @return mixed + * @return string * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ protected function registerApi(&$url, $method, $arguments = []) { $this->currentMethod = ['method' => $method, 'arguments' => $arguments]; - if (empty($this->access_token)) { - $this->access_token = $this->getAccessToken(); - } - return $url = str_replace('ACCESS_TOKEN', $this->access_token, $url); + if (empty($this->access_token)) $this->access_token = $this->getAccessToken(); + return $url = str_replace('ACCESS_TOKEN', urlencode($this->access_token), $url); } /**