getMiniProgramObj()获取小程序 Sdk对象 ~~~ /** * @param array $options * @return \miniprogram\MiniProgram * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ function getMiniProgramObj($options=[]) { if(empty($options)){ $options = \think\facade\Session::get('miniapp_options'); if (empty($options)) { $infos = getMimiappInfo(); $options['appid'] = $infos['appid']; $options['appsecret'] = $infos['appsecret']; $options['token'] = $infos['token']; $options['encodingaeskey'] = $infos['encodingaeskey']; } } include_once EXTEND_PATH . "miniprogram/MiniProgram.php"; return new \miniprogram\MiniProgram($options); } ~~~