<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ~~~ 'use strict'; var Hogan = require('hogan'); var conf = { serverHost : '' }; var _mm = { // 網絡請求 request : function(param){ var _this = this; $.ajax({ type : param.method || 'get', url : param.url || '', dataType : param.type || 'json', data : param.data || '', success : function(res){ // 請求成功 if(0 === res.status){ typeof param.success === 'function' && param.success(res.data, res.msg); } // 沒有登錄狀態,需要強制登錄 else if(10 === res.status){ _this.doLogin(); } // 請求數據錯誤 else if(1 === res.status){ typeof param.error === 'function' && param.error(res.msg); } }, error : function(err){ typeof param.error === 'function' && param.error(err.statusText); } }); }, // 獲取服務器地址 getServerUrl : function(path){ return conf.serverHost + path; }, // 獲取url參數 getUrlParam : function(name){ var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); var result = window.location.search.substr(1).match(reg); return result ? decodeURIComponent(result[2]) : null; }, // 渲染html模板 renderHtml : function(htmlTemplate, data){ var template = Hogan.compile(htmlTemplate), result = template.render(data); return result; }, // 成功提示 successTips : function(msg){ alert(msg || '操作成功!'); }, // 錯誤提示 errorTips : function(msg){ alert(msg || '哪里不對了~'); }, // 字段的驗證,支持非空、手機、郵箱的判斷 validate : function(value, type){ var value = $.trim(value); // 非空驗證 if('require' === type){ return !!value; } // 手機號驗證 if('phone' === type){ return /^1\d{10}$/.test(value); } // 郵箱格式驗證 if('email' === type){ return /^(\w)+(\.\w+)*@(\w)+((\.\w{2,3}){1,3})$/.test(value); } }, // 統一登錄處理 doLogin : function(){ window.location.href = './user-login.html?redirect=' + encodeURIComponent(window.location.href); }, goHome : function(){ window.location.href = './index.html'; } }; module.exports = _mm; ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看