From f32697f0395dae9efcfb48d6e1b693559dc7f8df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=90=8D?= <邮箱> Date: Mon, 31 Jul 2023 15:01:44 +0800 Subject: [PATCH] test --- mobile/testsc2.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mobile/testsc2.php b/mobile/testsc2.php index 61ee9ff..8e52176 100644 --- a/mobile/testsc2.php +++ b/mobile/testsc2.php @@ -15,8 +15,10 @@ $auth_url = 'https://open.weixin.qq.com/connect/oauth2/authorize' . '&state=STATE'; // wechat_redirect // 如果用户已经授权,则重定向到回调URL,并获取用户的openid -if (isset($_GET['code'])) { - $code = $_GET['code']; +// if (isset($_GET['code'])) { +// $code = $_GET['code']; + + $code = '100010'; // 构造获取access_token的URL $token_url = 'https://api.weixin.qq.com/sns/oauth2/access_token' @@ -56,9 +58,9 @@ if (isset($_GET['code'])) { // // 在这里处理获取到的openid // echo $openid; -} else { - // 如果没有授权,则重定向到授权页面 - header('Location: ' . $auth_url); - exit(); -} +// } else { +// // 如果没有授权,则重定向到授权页面 +// header('Location: ' . $auth_url); +// exit(); +// } ?> \ No newline at end of file