正在显示
1 个修改的文件
包含
12 行增加
和
12 行删除
| @@ -24,18 +24,18 @@ class Login extends Base | @@ -24,18 +24,18 @@ class Login extends Base | ||
| 24 | { | 24 | { |
| 25 | $appid = $this->AppID; | 25 | $appid = $this->AppID; |
| 26 | $AppSecret = $this->AppSecret; | 26 | $AppSecret = $this->AppSecret; |
| 27 | - $post = $this->request->param(); | ||
| 28 | - $code = $post['code'];// I('post.code'); | ||
| 29 | - $encryptedData = $post['encryptedData'];//I('post.encryptedData'); | ||
| 30 | - $iv = $post['iv'];//I('post.iv'); | ||
| 31 | - | ||
| 32 | - if ($post['type'] == 1) { | ||
| 33 | - $encryptedData = urldecode($encryptedData); | ||
| 34 | - $iv = urldecode($iv); | ||
| 35 | - file_put_contents("ccc.txt", "授权A:" . date("Y-m-d H:i:s") . ":" . $encryptedData . PHP_EOL, FILE_APPEND); | ||
| 36 | -// file_put_contents("ccc.txt", "授权B:" . date("Y-m-d H:i:s") . ":" . $iv . PHP_EOL, FILE_APPEND); | ||
| 37 | - | ||
| 38 | - } | 27 | + $code = $this->request->param("code"); |
| 28 | +// $encryptedData = $this->request->param("encryptedData"); | ||
| 29 | +// $iv = $this->request->param("iv"); | ||
| 30 | +// $type = $this->request->param("type"); | ||
| 31 | +// | ||
| 32 | +// if ($type == 1) { | ||
| 33 | +// $encryptedData = urldecode($encryptedData); | ||
| 34 | +// $iv = urldecode($iv); | ||
| 35 | +// file_put_contents("ccc.txt", "授权A:" . date("Y-m-d H:i:s") . ":" . $encryptedData . PHP_EOL, FILE_APPEND); | ||
| 36 | +//// file_put_contents("ccc.txt", "授权B:" . date("Y-m-d H:i:s") . ":" . $iv . PHP_EOL, FILE_APPEND); | ||
| 37 | +// | ||
| 38 | +// } | ||
| 39 | 39 | ||
| 40 | $url = "https://api.weixin.qq.com/sns/jscode2session?appid=" . $appid . "&secret=" . $AppSecret . "&js_code=" . $code . "&grant_type=authorization_code"; | 40 | $url = "https://api.weixin.qq.com/sns/jscode2session?appid=" . $appid . "&secret=" . $AppSecret . "&js_code=" . $code . "&grant_type=authorization_code"; |
| 41 | $res = json_decode(http_request($url), true); | 41 | $res = json_decode(http_request($url), true); |
-
请 注册 或 登录 后发表评论