add clear
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace wchat;
|
||||
|
||||
|
||||
use common\Miniprogarampage;
|
||||
|
||||
class SmallProgram extends Miniprogarampage
|
||||
{
|
||||
|
||||
protected static $instance;
|
||||
|
||||
private $url = 'https://api.weixin.qq.com/cgi-bin/token';
|
||||
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
* @throws \Exception
|
||||
*/
|
||||
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()) {
|
||||
throw new \Exception($param->getMessage());
|
||||
}
|
||||
return $param->getData();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user