From 4127dc283a8f5c9467a66e66bab0b80ea1df8405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Fri, 22 May 2020 15:15:08 +0800 Subject: [PATCH] add clear --- wchat/common/HttpClient.php | 9 +++------ wchat/wx/PublicTemplate.php | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/wchat/common/HttpClient.php b/wchat/common/HttpClient.php index da7513c..eaa6773 100644 --- a/wchat/common/HttpClient.php +++ b/wchat/common/HttpClient.php @@ -633,12 +633,9 @@ class HttpClient if (!empty($this->agent)) { curl_setopt($ch, CURLOPT_USERAGENT, $this->agent); } - if (!empty($this->getSslCertFile())) { - curl_setopt($ch, CURLOPT_SSLCERT, $this->getSslCertFile()); - } - if (!empty($this->getSslCertFile())) { - curl_setopt($ch, CURLOPT_SSLCERT, $this->getSslCertFile()); - } + + curl_setopt($ch, CURLOPT_SSLCERT, $this->getSslCertFile()); + curl_setopt($ch, CURLOPT_SSLCERT, $this->getSslCertFile()); curl_setopt($ch, CURLOPT_SSLKEY, $this->getSslKeyFile()); curl_setopt($ch, CURLOPT_NOBODY, FALSE); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1); // 超时设置 diff --git a/wchat/wx/PublicTemplate.php b/wchat/wx/PublicTemplate.php index 7125acb..818a626 100644 --- a/wchat/wx/PublicTemplate.php +++ b/wchat/wx/PublicTemplate.php @@ -149,8 +149,8 @@ class PublicTemplate extends SmallProgram $this->request->addHeader('content-type', 'application/json'); $this->request->setErrorField('errcode'); $this->request->setErrorMsgField('errmsg'); - $result = $this->request->post($url, $params); - $result->append('postBody', $params); + $result = $this->request->post($url, $default); + $result->append('postBody', $default); return $result; }