Skip to content

Commit 4b70fef

Browse files
1. 完善README.md
1 parent 5eafb98 commit 4b70fef

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ composer require hillpy/mini-program-sdk
2121
### 使用方法
2222

2323
* 实例化开发包、accessToken获取及缓存
24-
2524
```
2625
/**
2726
* 使用案例
@@ -66,7 +65,6 @@ if ($accessToken == '') {
6665
```
6766

6867
* 解密登录用户数据
69-
7068
```
7169
// 解密登录用户数据
7270
$paramArr['code'] = '';
@@ -83,6 +81,30 @@ if ($res['code'] == 100) {
8381
}
8482
```
8583

84+
* 获取无数量限制的小程序码
85+
```
86+
// 小程序码图片的保存路径
87+
$path = '';
88+
// 小程序码图片的保存名称
89+
$filename = '';
90+
91+
// 小程序码接口所需参数
92+
$paramArr['scene'] = '';
93+
$paramArr['page'] = '';
94+
$paramArr['width'] = '';
95+
$paramArr['auto_color'] = '';
96+
$paramArr['line_color'] = '';
97+
$paramArr['is_hyaline'] = '';
98+
99+
// 请求小程序码接口
100+
$res = $miniProgram->getWxacodeUnlimit($paramArr);
101+
102+
// 打开文件并写入二进制流,生成图片
103+
$file = fopen($path . $filename, 'w');
104+
fwrite($file, $res);
105+
fclose($file);
106+
```
107+
86108

87109
### 仓库地址
88110

0 commit comments

Comments
 (0)