<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 功能強大 支持多語言、二開方便! 廣告
                //申請各個開發平臺的開發者 微信: https://open.weixin.qq.com/ QQ: http://open.qq.com/ 微博: http://open.weibo.com/ //設置 manifest.json -> SDK配置 //初始化QQ登錄,微信登錄,微博登錄 ``` var auths={}; mui.plusReady(function(){ // 獲取登錄認證通道 plus.oauth.getServices(function(services){ for(var i in services){ var service=services[i]; auths[service.id]=service; } },function(e){ outLine("獲取登錄認證失敗:"+e.message); }); }); ``` //調用認證事件 ``` // id 為 qq,weixin,weibo function login(id){ console.log("----- 登錄認證 -----"); var auth=auths[id]; if(auth){ var w=plus.nativeUI.showWaiting(); document.addEventListener("pause",function(){ setTimeout(function(){ w&&w.close();w=null; },2000); }, false ); auth.login(function(){ w&&w.close();w=null; console.log("登錄認證成功:"); console.log(JSON.stringify(auth.authResult)); userinfo(auth); },function(e){ w&&w.close();w=null; console.log("登錄認證失敗:"); console.log("["+e.code+"]:"+e.message); plus.nativeUI.alert("詳情錯誤信息請參考授權登錄(OAuth)規范文檔:http://www.html5plus.org/#specification#/specification/OAuth.html",null,"登錄失敗["+e.code+"]:"+e.message); }); }else{ console.log("無效的登錄認證通道!"); plus.nativeUI.alert("無效的登錄認證通道!",null,"登錄"); } } // 獲取用戶信息 function userinfo(a){ console.log("----- 獲取用戶信息 -----"); a.getUserInfo(function(){ console.log("獲取用戶信息成功:"); console.log(JSON.stringify(a.userInfo)); var nickname=a.userInfo.nickname||a.userInfo.name; plus.nativeUI.alert("歡迎“"+nickname+"”登錄!"); },function(e){ console.log("獲取用戶信息失敗:"); console.log("["+e.code+"]:"+e.message); plus.nativeUI.alert("獲取用戶信息失敗!",null,"登錄"); }); } // 注銷登錄 function logoutAll(){ console.log("----- 注銷登錄認證 -----"); for(var i in auths){ logout(auths[i]); } } function logout(auth){ auth.logout(function(){ outLine("注銷\""+auth.description+"\"成功"); },function(e){ outLine("注銷\""+auth.description+"\"失敗:"+e.message); }); } ```
                  <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>

                              哎呀哎呀视频在线观看