From 4b70fefd0624920a9fea2d43d3e66fa3887f516e Mon Sep 17 00:00:00 2001 From: shinn lancelot <945226793@qq.com> Date: Thu, 1 Nov 2018 13:53:56 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E5=AE=8C=E5=96=84README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index efb975d..13eec8f 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,6 @@ composer require hillpy/mini-program-sdk ### 使用方法 * 实例化开发包、accessToken获取及缓存 - ``` /** * 使用案例 @@ -66,7 +65,6 @@ if ($accessToken == '') { ``` * 解密登录用户数据 - ``` // 解密登录用户数据 $paramArr['code'] = ''; @@ -83,6 +81,30 @@ if ($res['code'] == 100) { } ``` +* 获取无数量限制的小程序码 +``` +// 小程序码图片的保存路径 +$path = ''; +// 小程序码图片的保存名称 +$filename = ''; + +// 小程序码接口所需参数 +$paramArr['scene'] = ''; +$paramArr['page'] = ''; +$paramArr['width'] = ''; +$paramArr['auto_color'] = ''; +$paramArr['line_color'] = ''; +$paramArr['is_hyaline'] = ''; + +// 请求小程序码接口 +$res = $miniProgram->getWxacodeUnlimit($paramArr); + +// 打开文件并写入二进制流,生成图片 +$file = fopen($path . $filename, 'w'); +fwrite($file, $res); +fclose($file); +``` + ### 仓库地址