_login.html 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
  6. <title>登录演示</title>
  7. <!-- <script src="./js/dwudbproxy-wan.js"></script> -->
  8. <!-- <script src="../../../pub/common/js/dwudbproxy.js"></script> -->
  9. </head>
  10. <body>
  11. <!--<link href="./dwUDBProxy/css/login.css" rel="stylesheet" type="text/css">-->
  12. <div style="height:40px;">
  13. 服务器时间[用来查看页面是否有刷新]:
  14. <strong style="color:red">2017-11-06 13:55:34</strong>
  15. </div>
  16. <div id="udb_login_yes">
  17. <p>
  18. UDB登录:
  19. <button id="udb_login">udb登录[刷新页面]</button>
  20. <button id="udb_login_callback">udb登录[不刷新页面]</button>
  21. </p>
  22. <p>
  23. 多玩网第三方登录:
  24. <button id="duowan_third_login">第三方登录[刷新页面]</button>
  25. <button id="duowan_third_login_callback">第三方登录[不刷新页面]</button>
  26. </p>
  27. <p>
  28. 手机UDB登录:
  29. <button id="udb_mobile_login">第三方登录[刷新当前页面]</button>
  30. </p>
  31. <p>
  32. 多玩网第三方注册:
  33. <button id="udb_mobile_register">第三方注册[不刷新当前页面]</button>
  34. </p>
  35. <p>
  36. 多玩特权登录:
  37. <button id="udb_ka_login">读完特权登录</button>
  38. </p>
  39. <p>
  40. H5微信登录定制:
  41. <button id="udb_wechat_login">H5微信登录定制</button>
  42. </p>
  43. </div>
  44. <div id="udb_login_no">
  45. <span id="username"></span>
  46. <button id="udb_logout">退出登录</button>
  47. <a href="/auth" target="_blank">查看后端验证</a>
  48. <div class="btn-wrap">
  49. <button class="btn-bind" data-type="qq">绑定账号QQ</button>
  50. <button class="btn-bind" data-type="weixin">绑定账号WX</button>
  51. <button class="btn-unbind" data-type="weibo">绑定账号WEIBO</button>
  52. </div>
  53. </div>
  54. <!--<div class="dw-account-login-pop" style="display: block;">
  55. <div class="dw-login-wrap">
  56. <div class="dw-login-inner">
  57. <h3>请选择您的登录方式</h3>
  58. <ul>
  59. <li>
  60. <div class="login-btn-yy" title="YY登录"></div>
  61. <p>YY登录</p>
  62. </li>
  63. <li>
  64. <div class="login-btn-qq" title="QQ登录"></div>
  65. <p>QQ登录</p>
  66. </li>
  67. <li>
  68. <div class="login-btn-wechat" title="微信登录"></div>
  69. <p>微信登录</p>
  70. </li>
  71. </ul>
  72. <p class="dw-account-other-login">
  73. <button type="button" class="login-btn-old" title="旧版第三方登录">旧版第三方登录</button>
  74. 其它登录方式:<button type="button" class="login-btn-weibo" title="新浪微博登录">新浪微博</button>
  75. </p>
  76. </div>
  77. </div>
  78. <a class="close" title="关闭">退出</a>
  79. </div>
  80. <div class="account-login-mask" style="display:block;"></div>-->
  81. <script src="http://pub.dwstatic.com/common/js/jquery.js"></script>
  82. <script src="http://pub.ouj.com/common//js/dwudbproxy-wan.js"></script>
  83. <script>
  84. var plainFunction = function () { }
  85. $(function () {
  86. init()
  87. function init() {
  88. if (dwUDBProxy.isLogin()) {
  89. $('#username').html(dwUDBProxy.getCookie('username'));
  90. $('#udb_login_yes').hide();
  91. $('#udb_login_no').show();
  92. } else {
  93. $('#udb_login_yes').show();
  94. $('#udb_login_no').hide();
  95. $('#username').html('');
  96. }
  97. }
  98. $('#udb_login').click(function () {
  99. dwUDBProxy.login(''); //为空,登录成功后则跳转到当前页面
  100. });
  101. dwUDBProxy.add(function (user) {
  102. $('#username').html(user.username);
  103. $('#udb_login_yes').hide();
  104. $('#udb_login_no').show();
  105. })
  106. $('#udb_login_callback').click(function () {
  107. dwUDBProxy.login(plainFunction);
  108. });
  109. $('#vhuya_third_login').click(function () {
  110. dwUDBProxy.multiLogin('/demo'); //为空,登录成功后则跳转到当前页面
  111. });
  112. $('#vhuya_third_login_callback').click(function () {
  113. dwUDBProxy.multiLogin(function () { //回调函数,登录成功后执行
  114. init();
  115. });
  116. });
  117. $('#duowan_third_login').click(function () {
  118. dwUDBProxy.multiLogin('/demo'); //为空,登录成功后则跳转到当前页面
  119. });
  120. $('#duowan_third_login_callback').click(function () {
  121. dwUDBProxy.login(function () { //回调函数,登录成功后执行
  122. init();
  123. });
  124. });
  125. $('#udb_wechat_login').click(function () {
  126. dwUDBProxy.login({
  127. defaultCallbck: function () {
  128. },
  129. wechatClickCallback: function (thirdLogin) {
  130. thirdLogin.closeLoginPopup()
  131. }
  132. });
  133. })
  134. $('#udb_ka_login').click(function () {
  135. dwUDBProxy.kaLogin()
  136. })
  137. $('#udb_mobile_register').click(function () {
  138. dwUDBProxy.register(function () {
  139. // alert(11111)
  140. })
  141. })
  142. $('#udb_mobile_login').click(function () {
  143. dwUDBProxy.login(function () {
  144. }); //为空,登录成功后则跳转到当前页面
  145. });
  146. $('#udb_logout').click(function () {
  147. dwUDBProxy.logout(plainFunction); //为空,退出成功后则跳转到当前页面
  148. });
  149. dwUDBProxy.addLogout(function(){
  150. init()
  151. })
  152. dwUDBProxy.addBind(function () {
  153. console.log('绑定成功')
  154. })
  155. $('.btn-bind').on('click', function () {
  156. var $this = $(this),
  157. type = $this.data('type')
  158. dwUDBProxy.bind(type, function () { })
  159. })
  160. dwUDBProxy.getUser(function (ret) {
  161. // console.log(ret)
  162. })
  163. $('.btn-unbind').on('click', function () {
  164. var $this = $(this),
  165. type = $this.data('type')
  166. dwUDBProxy.unBind(type, function (ret) {
  167. console.log(ret)
  168. })
  169. })
  170. });
  171. </script>
  172. <script src="./dwNavBar2017/navbar2017.js"></script>
  173. </body>
  174. </html>