add clear
This commit is contained in:
@@ -14,10 +14,11 @@ abstract class AfficialAccount extends Miniprogarampage
|
||||
private $url = 'https://api.weixin.qq.com/cgi-bin/token?';
|
||||
|
||||
/**
|
||||
* @param bool $get_token
|
||||
* @return mixed
|
||||
* @throws
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function generateAccess_token()
|
||||
public function generateAccess_token($get_token = false)
|
||||
{
|
||||
if (!empty($this->config->getToken())) {
|
||||
return $this->config->getToken();
|
||||
@@ -30,6 +31,11 @@ abstract class AfficialAccount extends Miniprogarampage
|
||||
if (!$result->isResultsOK()) {
|
||||
throw new \Exception($result->getMessage(), $result->getCode());
|
||||
}
|
||||
|
||||
if ($get_token) {
|
||||
return $result->getData('access_token');
|
||||
}
|
||||
|
||||
return $result->getData();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user