From 50dd519e091493e08850d15b7eef934f6e519658 Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Fri, 15 Dec 2023 14:10:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95=E5=88=A4?= =?UTF-8?q?=E6=96=AD=EF=BC=8C=E4=BF=AE=E6=94=B9=E7=97=85=E6=83=85=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=9B=9E=E5=86=99=E4=BC=A0=E6=97=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AutoFinishInquiryDelayDirectConsumer.php | 2 +- app/Services/LoginService.php | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/Amqp/Consumer/AutoFinishInquiryDelayDirectConsumer.php b/app/Amqp/Consumer/AutoFinishInquiryDelayDirectConsumer.php index b7763bb..a50faf3 100644 --- a/app/Amqp/Consumer/AutoFinishInquiryDelayDirectConsumer.php +++ b/app/Amqp/Consumer/AutoFinishInquiryDelayDirectConsumer.php @@ -138,7 +138,7 @@ class AutoFinishInquiryDelayDirectConsumer extends ConsumerMessage $this->handleOrderInquiryCase($order_inquiry); // 处理回写患者病情记录-回写失败不做处理 - $this->handlePatientPathography($order_inquiry['order_inquiry_id']); + $this->handlePatientPathography($order_inquiry); // 处理医生服务患者数量 $this->handleDoctorServedPatientsNum($order_inquiry['doctor_id']); diff --git a/app/Services/LoginService.php b/app/Services/LoginService.php index e42f146..d78bd84 100644 --- a/app/Services/LoginService.php +++ b/app/Services/LoginService.php @@ -38,22 +38,32 @@ class LoginService extends BaseService $wx_code = $this->request->input('wx_code'); $user_type = $this->request->input('user_type'); + // 获取微信用户数据 try { $weChat = new Wechat($user_type); // 获取手机号 $phone_info = $weChat->getPhone($phone_code); - if (empty($phone_info) || empty($phone_info['phone_info']) || empty($phone_info['phone_info']['purePhoneNumber'])) { + if (empty($phone_info)){ + return fail(HttpEnumCode::GET_WX_ERROR); + } + + if (empty($phone_info['phone_info']) || empty($phone_info['phone_info']['purePhoneNumber'])) { return fail(HttpEnumCode::GET_WX_ERROR); } // 获取用户openid $wx_info_data = $weChat->codeToSession($wx_code); + if (empty($wx_info_data)){ + return fail(HttpEnumCode::GET_WX_ERROR); + } + if (empty($wx_info_data['session_key']) || empty($wx_info_data['openid'])) { return fail(HttpEnumCode::GET_WX_ERROR); } }catch (\Throwable $e){ + Log::getInstance("LoginService-wechatMobileLogin")->error($e->getMessage()); return fail(HttpEnumCode::GET_WX_ERROR); } @@ -86,7 +96,7 @@ class LoginService extends BaseService $data['mobile'] = $phone_info['phone_info']['purePhoneNumber']; $data['wx_mobile'] = $phone_info['phone_info']['purePhoneNumber']; $data['user_type'] = $user_type; - $data['register_method'] = 1;//注册方式(1:小程序授权 2:手机号 ) + $data['register_method'] = 1;// 注册方式(1:小程序授权 2:手机号) $data['avatar'] = $avatar; $user = UserModel::addUser($data); if (empty($user)) {