作者 郭文星

123

@@ -42,18 +42,19 @@ class Login extends Base @@ -42,18 +42,19 @@ class Login extends Base
42 if (!$res) { 42 if (!$res) {
43 $res = json_decode(http_request($url), true); 43 $res = json_decode(http_request($url), true);
44 } 44 }
45 - print_r($res);return;  
46 $sessionKey = $res['session_key']; 45 $sessionKey = $res['session_key'];
47 $openid = $res['openid'];//获取用户openid 46 $openid = $res['openid'];//获取用户openid
48 - $unionid = $res['unionid'];//获取用户openid 47 + //$unionid = $res['unionid'];//获取用户openid
49 // file_put_contents("ccc.txt", "授权1:" . date("Y-m-d H:i:s") . ":" . json_encode($res, JSON_UNESCAPED_UNICODE) . PHP_EOL, FILE_APPEND); 48 // file_put_contents("ccc.txt", "授权1:" . date("Y-m-d H:i:s") . ":" . json_encode($res, JSON_UNESCAPED_UNICODE) . PHP_EOL, FILE_APPEND);
50 49
51 require_once '../extend/lib/WXBizDataCrypt.class.php'; 50 require_once '../extend/lib/WXBizDataCrypt.class.php';
52 51
53 $pc = new WXBizDataCrypt($appid, $sessionKey); 52 $pc = new WXBizDataCrypt($appid, $sessionKey);
54 - $errCode = $pc->decryptData($encryptedData, $iv, $data); 53 + print_r($pc);return;
55 54
56 - $data = json_decode($data, true); 55 + //$errCode = $pc->decryptData($encryptedData, $iv, $data);
  56 +
  57 + //$data = json_decode($data, true);
57 // file_put_contents("ccc.txt", "授权2:" . date("Y-m-d H:i:s") . ":" . $errCode . PHP_EOL, FILE_APPEND); 58 // file_put_contents("ccc.txt", "授权2:" . date("Y-m-d H:i:s") . ":" . $errCode . PHP_EOL, FILE_APPEND);
58 // file_put_contents("ccc.txt", "授权3:" . date("Y-m-d H:i:s") . ":" . json_encode($data, JSON_UNESCAPED_UNICODE) . PHP_EOL, FILE_APPEND); 59 // file_put_contents("ccc.txt", "授权3:" . date("Y-m-d H:i:s") . ":" . json_encode($data, JSON_UNESCAPED_UNICODE) . PHP_EOL, FILE_APPEND);
59 60