$mobile) { if ($mobile && strlen($mobile) == 11) { ShortMessageService::instance()->singleMsg($throw_msg, $mobile); LogService::info("ThrowNotice:发送内容:" . $throw_msg . ":手机号:" . $mobile); } } } } /** * 发送短信验证码 * @param $phone 手机号 * @return int */ public function sendShortMsg($phone) { $code = ShortMessageService::instance()->generateSMSCode(); $content = "您的验证码为{$code},五分钟内有效,切勿将验证码泄露与他人。如有问题请联系客服!"; try { $data = ShortMessageService::instance()->singleShortMsg($content, $phone); if ($data['code']) { return $code; } else { LogService::error('VipShortMsgService:' . $data['code']); return false; } } catch (\Exception $e) { LogService::error($e->getMessage()); return false; } } }