From 00e42df5568a8e40406220c5886ebcce759a9536 Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Mon, 20 Feb 2023 08:46:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=B5=8B=E8=AF=95=E6=A0=87?= =?UTF-8?q?=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/LoginService.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/Services/LoginService.php b/app/Services/LoginService.php index cf3bbb3..3f27b53 100644 --- a/app/Services/LoginService.php +++ b/app/Services/LoginService.php @@ -31,19 +31,19 @@ class LoginService extends BaseService $weChat = $this->container->get(WeChat::class); -// // 获取手机号 -// $phone_info = $weChat->getPhone($phone_code); -// if (empty($phone_info) || empty($phone_info['phone_info']) || empty($phone_info['phone_info']['purePhoneNumber'])){ -// return fail(HttpEnumCode::GET_WX_ERROR); -// } - $phone_info['phone_info']['purePhoneNumber'] = "18221234161"; + // 获取手机号 + $phone_info = $weChat->getPhone($phone_code); + if (empty($phone_info) || empty($phone_info['phone_info']) || empty($phone_info['phone_info']['purePhoneNumber'])){ + return fail(HttpEnumCode::GET_WX_ERROR); + } +// $phone_info['phone_info']['purePhoneNumber'] = "18221234161"; // 获取用户openid -// $wx_info_data = $weChat->codeToSession($wx_code); - $wx_info_data = array( - "session_key" => "SWfpkHtKZRq/G0ONoxigaQ==", - "openid" => "o9gYG441zEAHuYoNX7lwFKiQBzKE", - ); + $wx_info_data = $weChat->codeToSession($wx_code); +// $wx_info_data = array( +// "session_key" => "SWfpkHtKZRq/G0ONoxigaQ==", +// "openid" => "o9gYG441zEAHuYoNX7lwFKiQBzKE", +// ); if (empty($wx_info_data['session_key']) || empty($wx_info_data['openid'])) { return fail(HttpEnumCode::GET_WX_ERROR); }