add clear

This commit is contained in:
as2252258@163.com
2019-10-25 15:20:09 +08:00
parent 7011a4569d
commit 4a3a3a5091
11 changed files with 1812 additions and 6 deletions
+31
View File
@@ -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');
}
}