add clear
This commit is contained in:
+5
-6
@@ -118,14 +118,13 @@ class Template extends Miniprogarampage
|
||||
*/
|
||||
public function sendTemplate()
|
||||
{
|
||||
$url = $this->sendUrl . '?access_token=' . $this->getAccessToken();
|
||||
|
||||
$url = $this->sendUrl . '?access_token=' . $this->config->getAccessToken();
|
||||
$params = json_encode([
|
||||
"touser" => $this->openId,
|
||||
"touser" => $this->openId,
|
||||
"template_id" => $this->templateId,
|
||||
"page" => $this->page,
|
||||
"form_id" => $this->formId,
|
||||
"data" => $this->keywords,
|
||||
"page" => $this->page,
|
||||
"form_id" => $this->formId,
|
||||
"data" => $this->keywords,
|
||||
], JSON_UNESCAPED_UNICODE);
|
||||
|
||||
if (!empty($this->emphasis_keyword)) {
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace wchat;
|
||||
|
||||
|
||||
class Token extends Miniprogarampage
|
||||
{
|
||||
|
||||
private $url = 'https://api.q.qq.com/cgi-bin/token';
|
||||
|
||||
|
||||
/**
|
||||
* @return mixed|null
|
||||
*/
|
||||
public function generateAccess_token()
|
||||
{
|
||||
$query = [
|
||||
'grant_type' => 'client_credential',
|
||||
'appid' => $this->config->getAppid(),
|
||||
'secret' => $this->config->getAppsecret()
|
||||
];
|
||||
$param = $this->request->get($this->url, $query);
|
||||
if (!$param->isResultsOK()) {
|
||||
return null;
|
||||
}
|
||||
return $param->getData('access_token');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user