Skip to content

Commit 8f5241c

Browse files
1. 修改命名空间 2. 修改login
1 parent 81acb8c commit 8f5241c

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "hillpy/mini-program-sdk",
33
"description": "a miniprogram sdk",
44
"keywords": ["小程序", "miniprogram", "微信", "wechat"],
5-
"version": "1.0.1",
5+
"version": "1.0.2",
66
"type": "library",
77
"license": "MIT",
88
"authors": [

demo.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?php
22

3-
use hillpy\MiniProgramSDK;
3+
use hillpy\MiniProgramSDK\MiniProgram;
44

55
$appid = '';
66
$appsecret = '';
77

8-
$MiniProgramSDK = new MiniProgramSDK($appid, $appsecret);
8+
$MiniProgram = new MiniProgram($appid, $appsecret);
99

1010
$params['code'] = '';
1111
$params['rawData'] = '';
1212
$params['signature'] = '';
1313
$params['encryptedData'] = '';
1414
$params['iv'] = '';
15-
$res = $MiniProgramSDK->login($params);
15+
$res = $MiniProgram->decryptData($params);
1616

1717
if ($res['code'] == 100) {
1818
echo '登录成功';

src/MiniProgram.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
* 微信小程序api封装类
55
* Author: shinn_lancelot
66
*/
7-
namespace hillpy;
7+
namespace hillpy\MiniProgramSDK;
88

9-
class MiniProgramSDK
9+
class MiniProgram
1010
{
1111
private $appId = '';
1212
private $appSecret = '';
@@ -23,11 +23,11 @@ public function __construct($appId, $appSecret)
2323
}
2424

2525
/**
26-
* 小程序登录封装
26+
* 小程序登录解密用户数据
2727
* @param array $params
2828
* @return mixed
2929
*/
30-
public function login($params = array())
30+
public function decryptData($params = array())
3131
{
3232
// 初始化返回数据
3333
$res['code'] = -100;

0 commit comments

Comments
 (0)