18 lines
456 B
PHP
18 lines
456 B
PHP
<?php
|
|
|
|
namespace Wechat\Work;
|
|
|
|
|
|
class Miniprogram extends Base
|
|
{
|
|
protected $app = 'miniprogram';
|
|
|
|
public function code2Session($type = 'authorization_code')
|
|
{
|
|
$url = "https://qyapi.weixin.qq.com/cgi-bin/miniprogram/jscode2session?js_code=$code&grant_type=$type");
|
|
$request = $this->client->transformForJsonRequest($url);
|
|
$resp = $this->client->send($request);
|
|
return json_decode($resp->getBody(), true);
|
|
}
|
|
|
|
} |