28 lines
486 B
PHP
28 lines
486 B
PHP
<?php
|
|
|
|
namespace Wechat\Work;
|
|
|
|
|
|
class Miniprogram
|
|
{
|
|
|
|
/**
|
|
* @var Work
|
|
*/
|
|
protected $work;
|
|
|
|
public function __construct($work)
|
|
{
|
|
$this->work = $work;
|
|
}
|
|
|
|
public function code2Session($code, $type = 'authorization_code')
|
|
{
|
|
$request = $this->work->transformForGetRequest('miniprogram/jscode2session', [
|
|
'js_code' => $code,
|
|
'grant_type' => $type,
|
|
]);
|
|
return $this->work->request($request);
|
|
}
|
|
|
|
} |