diff --git a/wchat/officialaccount/Subscribe.php b/wchat/officialaccount/Subscribe.php index 40a42d3..25a8ffb 100644 --- a/wchat/officialaccount/Subscribe.php +++ b/wchat/officialaccount/Subscribe.php @@ -97,7 +97,7 @@ class Subscribe extends AfficialAccount } /** - * @return array|mixed|\common\Result + * @return array|mixed|\wchat\common\Result */ public function sendSubscribeMessage() { diff --git a/wchat/qq/Subject.php b/wchat/qq/Subject.php index 6fb238e..ba84fea 100644 --- a/wchat/qq/Subject.php +++ b/wchat/qq/Subject.php @@ -109,17 +109,19 @@ class Subject extends SmallProgram public function sendTemplate() { $url = $this->sendUrl . '?access_token=' . $this->config->getAccessToken(); - $params = json_encode([ + $params = [ "touser" => $this->openId, "template_id" => $this->templateId, "page" => $this->page, "data" => $this->keywords, - ], JSON_UNESCAPED_UNICODE); + ]; if (!empty($this->emphasis_keyword)) { $params['emphasis_keyword'] = $this->emphasis_keyword; } + $params = json_encode($params, JSON_UNESCAPED_UNICODE); + $this->request->setIsSSL(true); $this->request->addHeader('content-type', 'application/json'); diff --git a/wchat/wx/Subject.php b/wchat/wx/Subject.php index 3398341..ff41a0b 100644 --- a/wchat/wx/Subject.php +++ b/wchat/wx/Subject.php @@ -109,17 +109,19 @@ class Subject extends SmallProgram public function sendTemplate() { $url = $this->sendUrl . '?access_token=' . $this->config->getAccessToken(); - $params = json_encode([ + $params = [ "touser" => $this->openId, "template_id" => $this->templateId, "page" => $this->page, "data" => $this->keywords, - ], JSON_UNESCAPED_UNICODE); + ]; if (!empty($this->emphasis_keyword)) { $params['emphasis_keyword'] = $this->emphasis_keyword; } + $params = json_encode($params, JSON_UNESCAPED_UNICODE); + $this->request->setIsSSL(true); $this->request->addHeader('content-type', 'application/json');