add clear

This commit is contained in:
as2252258@163.com
2019-11-11 18:14:47 +08:00
parent 62a2326e23
commit 7f138ef255
47 changed files with 2440 additions and 1100 deletions
+36
View File
@@ -0,0 +1,36 @@
<?php
namespace qq;
use common\Miniprogarampage;
class SmallProgram extends Miniprogarampage
{
protected static $instance;
private $url = 'https://api.q.qq.com/api/getToken';
/**
* @return mixed|null
*/
public function generateAccess_token()
{
if (!empty($this->config->getToken())) {
return $this->config->getToken();
}
$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');
}
}