public static function getOauthAccessToken($code) { $appId = parent::getApi()->getAppId(); $secret = parent::getApi()->getAppSecret(); $grant_type = 'authorization_code'; $url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid={$appId}&secret={$secret}&code={$code}&grant_type={$grant_type}"; return parent::request($url); }