add clear

This commit is contained in:
as2252258@163.com
2019-07-17 17:27:31 +08:00
parent 9c6b01fc94
commit 2c711e5480
6 changed files with 57 additions and 35 deletions
+7 -1
View File
@@ -51,6 +51,10 @@ abstract class Miniprogarampage
*/
protected function getAccessToken()
{
$access = $this->config->getAccessToken();
if (!empty($access)) {
return $access;
}
$this->request->setMethod(WxClient::GET);
$data = $this->request->get('/cgi-bin/token', [
'grant_type' => 'client_credential',
@@ -60,7 +64,9 @@ abstract class Miniprogarampage
if (!$data->isResultsOK()) {
throw new \Exception($data->getMessage());
}
return $data->getData('access_token');
$access = $data->getData('access_token');
$this->config->setAccessToken($access);
return $access;
}
/**