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); }