当前位置: 首页 > 工具软件 > EasyWeChat > 使用案例 >

easywechat6 含参数二维码

喻子航
2023-12-01

##总共两个步骤
1先获取ticket

 $app = app('easywechat.official_account');
        $api = $app->getClient();
        $str = ‘abc’;
        $response = $api->postJson('/cgi-bin/qrcode/create', [
            "expire_seconds" => 60 * 60 * 24,
            "action_name" => "QR_STR_SCENE",
            "action_info" => [
                "scene" => [
                    "scene_str" => $str
                ]
            ]

        ]);

##2
第二步骤

 return sprintf('https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=%s', urlencode($response['ticket']));
 类似资料: