企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
1. 找到小程序短信请求的接口文件 page/select/select.js 找到`sendmessg`方法,查看短信请求的接口:`/index.php?ctl=Login&met=wxappregCode&typ=json` 在`ucenter`内修改如下代码为其他短信平台所提供的接口文件 /* * 小程序短信验证码获取 * */ public function wxappregCode() { $mobile = request_string('mobile'); $check_code = mt_rand(100000, 999999); if ($mobile && Yf_Utils_String::isMobile($mobile)) { //判断手机号是否已经注册过 $User_InfoDetail = new User_InfoDetailModel(); $checkmobile = $User_InfoDetail -> checkMobile($mobile); if ($checkmobile) { $msg = _('该手机号已注册'); $status = 250; } else { $save_result = $this -> _saveCodeCache($mobile, $check_code, 'verify_code'); if (!$save_result) { $msg = _('发送失败'); $status = 250; } else { //发送短消息 $message_model = new Message_TemplateModel(); $pattern = array('/\[weburl_name\]/', '/\[yzm\]/'); $replacement = array(Web_ConfigModel::value("site_name"), $check_code); $message_info = $message_model -> getTemplateInfo(array('code' => 'regist_verify'), $pattern, $replacement); if (!$message_info['is_phone']) { $this -> data -> addBody(-140, array(), _('信息内容创建失败'), 250); } $contents = $message_info['content_phone']; $result = Sms::send($mobile, $contents); if ($result) { $msg = _('发送成功'); $status = 200; } else { $msg = _('发送失败'); $status = 250; } } } } else { $msg = __('发送失败'); $status = 250; } $data = array(); if (DEBUG === false) { $data['user_code'] = $check_code; } return $this -> data -> addBody(-140, $data, $msg, $status); }