小程序
登錄獲取用戶信息
注意:需要關聯小程序,并且使用關聯后的小程序
AgentId
與Secret
。
<?php
$config = [
// 企業微信后臺的 企業 ID
'corpId' => 'xxxxxxxxxxxxxxxxx',
// 企業微信后臺的 secret
'corpSecret' => 'xxxxxxxxxxxxxxxxx',
// 企業微信后臺的 agentid
'agentId' => 100020, // 如果有 agentid 則填寫
];
$miniProgram = new \EasySwoole\WeChat\Work\MiniProgram\Application($config);
$res = $miniProgram->auth->session("js-code");