add clear
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace qq;
|
||||
|
||||
|
||||
use common\Miniprogarampage;
|
||||
|
||||
class SmallProgram extends Miniprogarampage
|
||||
{
|
||||
|
||||
protected static $instance;
|
||||
|
||||
private $url = 'https://api.q.qq.com/api/getToken';
|
||||
|
||||
|
||||
/**
|
||||
* @param $get_token
|
||||
* @return mixed|null
|
||||
*/
|
||||
public function generateAccess_token($get_token = false)
|
||||
{
|
||||
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;
|
||||
}
|
||||
if ($get_token) {
|
||||
return $param->getData('access_token');
|
||||
}
|
||||
return $param->getData();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user