作者 郭文星

123

@@ -29,14 +29,15 @@ class Login extends Base @@ -29,14 +29,15 @@ class Login extends Base
29 $encryptedData = $post['encryptedData'];//I('post.encryptedData'); 29 $encryptedData = $post['encryptedData'];//I('post.encryptedData');
30 $iv = $post['iv'];//I('post.iv'); 30 $iv = $post['iv'];//I('post.iv');
31 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 - }  
39 - 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 +// }
  39 + $encryptedData = urldecode($encryptedData);
  40 + $iv = urldecode($iv);
40 $url = "https://api.weixin.qq.com/sns/jscode2session?appid=" . $appid . "&secret=" . $AppSecret . "&js_code=" . $code . "&grant_type=authorization_code"; 41 $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); 42 $res = json_decode(http_request($url), true);
42 if (!$res) { 43 if (!$res) {