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);
}
- 商城api接口
- 首頁數據獲取
- 分類接口
- 購物車接口
- 商品信息接口
- 搜索接口
- 訂單列表接口
- 店鋪接口
- 收藏接口
- 收貨地址接口
- 生成訂單接口
- 支付接口
- 會員中心接口
- 登錄注冊接口
- 關于我們
- 圖片上傳
- 分銷中心
- 分銷明細
- 代金券
- 平臺紅包列表
- 分銷申請列表
- 我的推廣
- 微信小程序
- 簡介
- 開發前準備
- 目錄結構介紹
- 發起請求
- 網絡請求提交表單
- 代碼及開發所遇到問題總結
- 導航跳轉時所遇到的問題
- 緩存數據與數據取得的問題
- 如何引入外部css
- 如何定義與使用全局變量
- 如何定義新的界面
- 微信小程序支付
- 小程序的手機驗證碼登錄
- 上傳,下載
- 提示框
- app.json配置
- 配置demo
- pages
- window
- tabBar
- networkTimeout
- debug
- page.json
- 緩存
- 特效
- 滑動方式
- 城市切換
- 五星好評
- Switch
- 上拉加載
- wxml 標簽
- 視圖容器
- 基礎內容
- 表單組件
- 導航
- 媒體組件
- 自定義提示框
- 小程序內訪問網頁
- 倒計時顯示
- 微信小程序,如何在返回前一個頁面時,執行前一個頁面的方法
- 在本地可以請求到數據,但手機上是請求不到的
- curl請求失敗
- 代碼同步
- 短信平臺更換