add clear

This commit is contained in:
as2252258@163.com
2020-03-05 12:41:49 +08:00
parent 0a16cc14e4
commit 291e882069
47 changed files with 104 additions and 107 deletions
-38
View File
@@ -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();
}
}