<pre id="4qa46"></pre>

  • <dl id="4qa46"><acronym id="4qa46"></acronym></dl>
    <rt id="4qa46"></rt>
    <abbr id="4qa46"><tbody id="4qa46"></tbody></abbr>
  • NODE.JS

    NODE.JS代碼示例

    /* *
     * 接口類型:達信通觸發短信接口,支持發送驗證碼短信、訂單通知短信等。
     * 賬戶注冊:請通過該地址開通賬戶http://sms.wx96.com/register.html
     * 注意事項:
    *(1)調試期間,請用默認的模板進行測試,默認模板詳見接口文檔;
     *(2)請使用 用戶名 及 APIkey來調用接口,APIkey在會員中心可以獲取;
    *(3)該代碼僅供接入達信通短信接口參考使用,客戶可根據實際需要自行編寫;
    */
     
    /**
     * Created by XadillaX on 14-2-12.
     * https://github.com/XadillaX/wx96106js
    */ String.prototype.replaceAll = function(reallyDo, replaceWith, ignoreCase) { if (!RegExp.prototype.isPrototypeOf(reallyDo)) { return this.replace(new RegExp(reallyDo, (ignoreCase ? "gi": "g")), replaceWith); } else { return this.replace(reallyDo, replaceWith); } }; var dom = require('xmldom').DOMParser; var _baseUri = "http://106.wx96.com/webservice/sms.php?method=Submit";
    var _userAgent = "node-wx96106-module by 死月 (admin@xcoder.in)";
    /** * wx96 constructure.
    * @param account * @param password 查看密碼請登錄用戶中心->驗證碼、通知短信->帳戶及簽名設置->APIKEY */ var wx96 = function(account, password) {
    this.spidex = require("spidex"); this.spidex.setDefaultUserAgent(_userAgent); this.account = account; this.password = password; }; /** * send an SMS. * @param mobile * @param content * @param callback */ wx96.prototype.send = function(mobile, content, callback) { var data = { account : this.account, password : this.password, mobile : mobile, content : content }; this.spidex.post(_baseUri, function(html, status) { if(status !== 200) { callback(new Error("短信發送服務器響應失敗。")); return; } html = html.replaceAll("\r", ""); html = html.replaceAll("\n", ""); html = html.replaceAll(" xmlns=\"http://106.wx96.com/\"", "");
    //console.log(html); var doc = new dom().parseFromString(html); var result = doc.lastChild; var json = {}; for(var node = result.firstChild; node !== null; node = node.nextSibling) { json[node.tagName] = node.firstChild.data; } //console.log(json); if(json.code == "2") { callback(null, json.smsid); } else { callback(new Error(json.msg, parseInt(json.code))); } }, data, "utf8").on("err", function(e) { callback(e); }); }; module.exports = wx96;
    在線咨詢
    電話咨詢

    服務熱線:

    4008 808 898

    服務熱線(工作時間):

    4008 808 898

    業務咨詢(非工作時間):

    4008 808 898

    售后咨詢(非工作時間):

    4008 808 898

    久久久久99精品成人片直播| 亚洲精品无码久久久| 中文字幕无码久久精品青草| 久久丫忘忧草产品| 精品精品国产自在久久高清| 国产成人精品久久亚洲高清不卡| 久久国产劲暴∨内射| 国产精品99久久免费| 久久久无码精品亚洲日韩按摩| 精品久久久无码中文字幕天天| 97久久精品无码一区二区天美 | 久久久久人妻精品一区三寸| 久久狠狠躁免费观看2020| 日产久久强奸免费的看| 久久综合亚洲鲁鲁五月天| 久久综合狠狠色综合伊人| 亚洲日本va午夜中文字幕久久 | 色综合久久久久久久久久| 色婷婷综合久久久久中文| 99久久中文字幕| 一97日本道伊人久久综合影院| 69SEX久久精品国产麻豆| 久久88色综合色鬼| 亚洲国产精品成人久久| 国产精品激情综合久久| 久久久久无码精品国产h动漫| 久久精品夜夜夜夜夜久久| 久久国产精品免费看| 久久国产一区二区| 久久久久这里只有精品| 国产精品久久久久久久久久久搜索| 国产精品久久久久免费a∨| 久久久精品2019免费观看| 久久国产精品免费专区| 亚洲中文字幕无码久久综合网| www.久久热.com| 日韩一区二区三区视频久久| 久久人人爽人人爽av片| 国产精品亚洲综合久久| 国产成人精品久久一区二区三区| 久久亚洲春色中文字幕久久久|