add clear
This commit is contained in:
@@ -4,9 +4,22 @@
|
||||
namespace wchat\officialaccount;
|
||||
|
||||
|
||||
use wchat\base\Access_Token;
|
||||
use wchat\common\HttpClient;
|
||||
|
||||
class AccessToken extends AfficialAccount
|
||||
class AccessToken extends AfficialAccount implements Access_Token
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @param false $get_token
|
||||
* @return mixed
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function generateAccess_token($get_token = false)
|
||||
{
|
||||
return parent::generateAccess_token($get_token); // TODO: Change the autogenerated stub
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class Authorization extends AfficialAccount
|
||||
|
||||
/**
|
||||
* @param $code
|
||||
* @return array|mixed|Result
|
||||
* @return Result
|
||||
* @throws Exception
|
||||
*/
|
||||
public function authorization_user_info($code)
|
||||
|
||||
Reference in New Issue
Block a user