正在显示
5 个修改的文件
包含
59 行增加
和
21 行删除
application/api/controller/Demo.php
已删除
100644 → 0
1 | -<?php | ||
2 | - | ||
3 | -include_once "wxBizDataCrypt.php"; | ||
4 | - | ||
5 | -/** | ||
6 | - * sessionKey/encryptedData/iv参数均从url中获取,并赋给相应变量 | ||
7 | - */ | ||
8 | -$appid = 'xxxxxxxx'; | ||
9 | -$sessionKey = $_REQUEST['session_key']; | ||
10 | -$encryptedData=$_REQUEST['encryptedData']; | ||
11 | -$iv = $_REQUEST['iv']; | ||
12 | - | ||
13 | -$pc = new WXBizDataCrypt($appid, $sessionKey); | ||
14 | -$errCode = $pc->decryptData($encryptedData, $iv, $data ); | ||
15 | - | ||
16 | -if ($errCode == 0) { | ||
17 | - print($data . "\n"); | ||
18 | -} else { | ||
19 | - print($errCode . "\n"); | ||
20 | -} | ||
21 | -?> |
@@ -761,4 +761,27 @@ class User extends Api | @@ -761,4 +761,27 @@ class User extends Api | ||
761 | $res = Db::name('renwu')->where('id', $param['order_id'])->where('xi_id', $user_id)->update($data); | 761 | $res = Db::name('renwu')->where('id', $param['order_id'])->where('xi_id', $user_id)->update($data); |
762 | $this->res($res); | 762 | $this->res($res); |
763 | } | 763 | } |
764 | + | ||
765 | + | ||
766 | + /** | ||
767 | + * 用户接口 | ||
768 | + * @ApiTitle (用户接口-手机号解析) | ||
769 | + * @ApiSummary (员工页面) | ||
770 | + * @ApiMethod (POST) | ||
771 | + * @ApiRoute (/api/User/MobileVi) | ||
772 | + * @ApiParams (name="encryptedData", type="int", required=true, description="encryptedData") | ||
773 | + * @ApiParams (name="iv", type="int", required=true, description="iv") | ||
774 | + * @ApiParams (name="sessionKey", type="int", required=true, description="sessionKey) | ||
775 | + * @ApiReturnParams (name="code", type="integer", required=true, sample="0") | ||
776 | + * @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功") | ||
777 | + * @ApiReturn ({ | ||
778 | + 'code':'1', | ||
779 | + 'msg':'返回成功', | ||
780 | + }) | ||
781 | + */ | ||
782 | + public function MobileVi() | ||
783 | + { | ||
784 | + | ||
785 | + $param = $this->request->param(); | ||
786 | + } | ||
764 | } | 787 | } |
application/demo/demo.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +include_once "wxBizDataCrypt.php"; | ||
4 | + | ||
5 | + | ||
6 | +$appid = 'wx4f4bc4dec97d474b'; | ||
7 | +$sessionKey = 'tiihtNczf5v6AKRyjwEUhQ=='; | ||
8 | + | ||
9 | +$encryptedData="CiyLU1Aw2KjvrjMdj8YKliAjtP4gsMZM | ||
10 | + QmRzooG2xrDcvSnxIMXFufNstNGTyaGS | ||
11 | + 9uT5geRa0W4oTOb1WT7fJlAC+oNPdbB+ | ||
12 | + 3hVbJSRgv+4lGOETKUQz6OYStslQ142d | ||
13 | + NCuabNPGBzlooOmB231qMM85d2/fV6Ch | ||
14 | + evvXvQP8Hkue1poOFtnEtpyxVLW1zAo6 | ||
15 | + /1Xx1COxFvrc2d7UL/lmHInNlxuacJXw | ||
16 | + u0fjpXfz/YqYzBIBzD6WUfTIF9GRHpOn | ||
17 | + /Hz7saL8xz+W//FRAUid1OksQaQx4CMs | ||
18 | + 8LOddcQhULW4ucetDf96JcR3g0gfRK4P | ||
19 | + C7E/r7Z6xNrXd2UIeorGj5Ef7b1pJAYB | ||
20 | + 6Y5anaHqZ9J6nKEBvB4DnNLIVWSgARns | ||
21 | + /8wR2SiRS7MNACwTyrGvt9ts8p12PKFd | ||
22 | + lqYTopNHR1Vf7XjfhQlVsAJdNiKdYmYV | ||
23 | + oKlaRv85IfVunYzO0IKXsyl7JCUjCpoG | ||
24 | + 20f0a04COwfneQAGGwd5oa+T8yO5hzuy | ||
25 | + Db/XcxxmK01EpqOyuxINew=="; | ||
26 | + | ||
27 | +$iv = 'r7BXXKkLb8qrSNn05n0qiA=='; | ||
28 | + | ||
29 | +$pc = new WXBizDataCrypt($appid, $sessionKey); | ||
30 | +$errCode = $pc->decryptData($encryptedData, $iv, $data ); | ||
31 | + | ||
32 | +if ($errCode == 0) { | ||
33 | + print($data . "\n"); | ||
34 | +} else { | ||
35 | + print($errCode . "\n"); | ||
36 | +} |
-
请 注册 或 登录 后发表评论