作者 郭文星

123

... ... @@ -29,14 +29,15 @@ class Login extends Base
$encryptedData = $post['encryptedData'];//I('post.encryptedData');
$iv = $post['iv'];//I('post.iv');
if ($post['type'] == 1) {
$encryptedData = urldecode($encryptedData);
$iv = urldecode($iv);
// file_put_contents("ccc.txt", "授权A:" . date("Y-m-d H:i:s") . ":" . $encryptedData . PHP_EOL, FILE_APPEND);
// file_put_contents("ccc.txt", "授权B:" . date("Y-m-d H:i:s") . ":" . $iv . PHP_EOL, FILE_APPEND);
}
// if ($post['type'] == 1) {
// $encryptedData = urldecode($encryptedData);
// $iv = urldecode($iv);
//// file_put_contents("ccc.txt", "授权A:" . date("Y-m-d H:i:s") . ":" . $encryptedData . PHP_EOL, FILE_APPEND);
//// file_put_contents("ccc.txt", "授权B:" . date("Y-m-d H:i:s") . ":" . $iv . PHP_EOL, FILE_APPEND);
//
// }
$encryptedData = urldecode($encryptedData);
$iv = urldecode($iv);
$url = "https://api.weixin.qq.com/sns/jscode2session?appid=" . $appid . "&secret=" . $AppSecret . "&js_code=" . $code . "&grant_type=authorization_code";
$res = json_decode(http_request($url), true);
if (!$res) {
... ...